diff options
| author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-09-09 13:15:16 +0000 |
|---|---|---|
| committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-09-09 13:15:16 +0000 |
| commit | 54455c239709e3f7719ab65777af3d71fc3c7331 (patch) | |
| tree | f6a4292bbcfc5ff50f08112477081a6401f7265a /sprintf.c | |
| parent | 278c898aae78aaefc5151c9a97ace96517f4345b (diff) | |
| download | ruby-54455c239709e3f7719ab65777af3d71fc3c7331.tar.gz ruby-54455c239709e3f7719ab65777af3d71fc3c7331.tar.xz ruby-54455c239709e3f7719ab65777af3d71fc3c7331.zip | |
* eval.c (rb_call0): prohibit calling tainted method (>2) when
$SAFE == 0.
* sprintf.c (rb_f_sprintf): warn "too many argument" on verbose
mode (-v/-w); backported from 1.9. [ruby-dev:26963]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@9108 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'sprintf.c')
| -rw-r--r-- | sprintf.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -771,11 +771,12 @@ rb_f_sprintf(argc, argv) } sprint_exit: - /* XXX - We cannot validiate the number of arguments because - * the format string may contain `n$'-style argument selector. + /* XXX - We cannot validiate the number of arguments if (digit)$ style used. */ - if (RTEST(ruby_debug) && posarg >= 0 && nextarg < argc) { - rb_raise(rb_eArgError, "too many arguments for format string"); + if (posarg >= 0 && nextarg < argc) { + const char *mesg = "too many arguments for format string"; + if (RTEST(ruby_debug)) rb_raise(rb_eArgError, mesg); + if (RTEST(ruby_verbose)) rb_warn(mesg); } rb_str_resize(result, blen); |
