summaryrefslogtreecommitdiff
path: root/ext/tk
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-01-12 08:11:36 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-01-12 08:11:36 +0000
commit9bd672f6682aef683c49f0b8da2b439e4d4103ac (patch)
tree17a6f91b7e705c4ba7bf32e6ceadd136e7b595f5 /ext/tk
parent42406852371bdf3fe3d2e4e51192c87720a8e568 (diff)
ext: use rb_sprintf() and rb_vsprintf() with PRIsVALUE
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44572 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tk')
-rw-r--r--ext/tk/tcltklib.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/ext/tk/tcltklib.c b/ext/tk/tcltklib.c
index 6f9aa90..5d20b25 100644
--- a/ext/tk/tcltklib.c
+++ b/ext/tk/tcltklib.c
@@ -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);