diff options
| author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-07-22 08:53:34 +0000 |
|---|---|---|
| committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-07-22 08:53:34 +0000 |
| commit | 2fed885b253b553592b05ab40a3f009dfcea0a41 (patch) | |
| tree | 4515bfaba327031545daeba38c244f3b5519cca2 /error.c | |
| parent | e8a03f98f83d0592edae30e58c365cdcdf84f3ad (diff) | |
| download | ruby-2fed885b253b553592b05ab40a3f009dfcea0a41.tar.gz ruby-2fed885b253b553592b05ab40a3f009dfcea0a41.tar.xz ruby-2fed885b253b553592b05ab40a3f009dfcea0a41.zip | |
* compile.c (insn_data_to_s_detail), file.c (rb_stat_inspect),
iseq.c (ruby_iseq_disasm_insn, ruby_iseq_disasm),
process.c (pst_message), re.c (match_inspect): use rb_str_catf.
* dir.c (dir_inspect), iseq.c (iseq_inspect, insn_operand_intern): use
rb_sprintf.
* error.c (rb_name_error, rb_raise, rb_loaderror, rb_fatal): use
rb_vsprintf.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18158 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'error.c')
| -rw-r--r-- | error.c | 24 |
1 files changed, 11 insertions, 13 deletions
@@ -621,13 +621,11 @@ rb_name_error(ID id, const char *fmt, ...) { VALUE exc, argv[2]; va_list args; - char buf[BUFSIZ]; va_start(args, fmt); - vsnprintf(buf, BUFSIZ, fmt, args); + argv[0] = rb_vsprintf(fmt, args); va_end(args); - argv[0] = rb_str_new2(buf); argv[1] = ID2SYM(id); exc = rb_class_new_instance(2, argv, rb_eNameError); rb_exc_raise(exc); @@ -1074,24 +1072,24 @@ void rb_raise(VALUE exc, const char *fmt, ...) { va_list args; - char buf[BUFSIZ]; + VALUE mesg; - va_start(args,fmt); - vsnprintf(buf, BUFSIZ, fmt, args); + va_start(args, fmt); + mesg = rb_vsprintf(fmt, args); va_end(args); - rb_exc_raise(rb_exc_new2(exc, buf)); + rb_exc_raise(rb_exc_new3(exc, mesg)); } void rb_loaderror(const char *fmt, ...) { va_list args; - char buf[BUFSIZ]; + VALUE mesg; va_start(args, fmt); - vsnprintf(buf, BUFSIZ, fmt, args); + mesg = rb_vsprintf(fmt, args); va_end(args); - rb_exc_raise(rb_exc_new2(rb_eLoadError, buf)); + rb_exc_raise(rb_exc_new3(rb_eLoadError, mesg)); } void @@ -1106,13 +1104,13 @@ void rb_fatal(const char *fmt, ...) { va_list args; - char buf[BUFSIZ]; + VALUE mesg; va_start(args, fmt); - vsnprintf(buf, BUFSIZ, fmt, args); + mesg = rb_vsprintf(fmt, args); va_end(args); - rb_exc_fatal(rb_exc_new2(rb_eFatal, buf)); + rb_exc_fatal(rb_exc_new3(rb_eFatal, mesg)); } void |
