diff options
Diffstat (limited to 'sprintf.c')
-rw-r--r-- | sprintf.c | 7 |
1 files changed, 2 insertions, 5 deletions
@@ -767,14 +767,11 @@ 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. + /* XXX - We cannot validiate the number of arguments if (digit)$ style used. */ - 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); |