merge revision(s) 44572,44578,44591,44592: [Backport #9490]

ext: use rb_sprintf() and rb_vsprintf() with PRIsVALUE

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@44903 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2014-02-10 11:45:14 +00:00
parent 73fc780998
commit 565d568a45
9 changed files with 58 additions and 69 deletions

View file

@ -848,15 +848,14 @@ create_ip_exc(interp, exc, fmt, va_alist)
#endif
{
va_list args;
char buf[BUFSIZ];
VALUE msg;
VALUE einfo;
struct tcltkip *ptr = get_ip(interp);
va_init_list(args,fmt);
vsnprintf(buf, BUFSIZ, fmt, args);
buf[BUFSIZ - 1] = '\0';
msg = rb_vsprintf(fmt, args);
va_end(args);
einfo = rb_exc_new2(exc, buf);
einfo = rb_exc_new_str(exc, msg);
rb_ivar_set(einfo, ID_at_interp, interp);
if (ptr) {
Tcl_ResetResult(ptr->ip);