diff options
Diffstat (limited to 'sprintf.c')
-rw-r--r-- | sprintf.c | 4 |
1 files changed, 1 insertions, 3 deletions
@@ -770,14 +770,12 @@ rb_f_sprintf(argc, argv) } sprint_exit: -#if 0 /* XXX - We cannot validiate the number of arguments because * the format string may contain `n$'-style argument selector. */ - if (RTEST(ruby_verbose) && nextarg < argc) { + if (RTEST(ruby_verbose) && posarg >= 0 && nextarg < argc) { rb_raise(rb_eArgError, "too many arguments for format string"); } -#endif rb_str_resize(result, blen); if (tainted) OBJ_TAINT(result); |