summaryrefslogtreecommitdiff
path: root/sprintf.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-10-27 09:29:26 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-10-27 09:29:26 +0000
commit018837b84f26adf1dd43ff0f41b211a41f5289e8 (patch)
tree4e552ee5749181b14dd80da1eb05d0dc9ed86645 /sprintf.c
parent6ffdbac5edcdeb0a9c916735cab125674c5a693d (diff)
* node.h (NODE_TYPESHIFT): allow 4 more bits for line numbers.
[ruby-talk:117841] * ruby.h (FL_ABLE): nodes are not subject for flag operations. * io.c (ARGF_FORWARD): should have specified argv explicitly, since we no longer have frame->argv saved. [ruby-dev:24602] * string.c (RESIZE_CAPA): check string attribute before modifying capacity member of string structure. [ruby-dev:24594] * ext/zlib/zlib.c (gzreader_gets): use memchr() to to gain performance. [ruby-talk:117701] * sprintf.c (rb_f_sprintf): raise ArgumentError for extra arguments, unless (digit)$ style used. * io.c (rb_io_fptr_finalize): leave stdin/stdout/stderr open in interpreter termination. [ruby-dev:24579] * eval.c (frame_free): Guy Decoux solved the leak problem. Thanks. [ruby-core:03549] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7121 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'sprintf.c')
-rw-r--r--sprintf.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/sprintf.c b/sprintf.c
index 1cb3c99d7c..16f9c35a3e 100644
--- a/sprintf.c
+++ b/sprintf.c
@@ -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);