diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-10-09 18:41:35 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-10-09 18:41:35 +0000 |
commit | 94355e2984dad584f409d732fea4310bbbd3588f (patch) | |
tree | d019e96a644151602262533c6ab22292e6258e52 /sprintf.c | |
parent | 017ff9bfa2daadb7c27953eb1ae70c2833dfa80c (diff) |
* sprintf.c (rb_str_format): check if codepoint for %c is valid.
[ruby-dev:36691]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19737 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'sprintf.c')
-rw-r--r-- | sprintf.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -618,7 +618,7 @@ rb_str_format(int argc, const VALUE *argv, VALUE fmt) c = NUM2INT(val); } n = rb_enc_codelen(c, enc); - if (n == 0) { + if (n <= 0) { rb_raise(rb_eArgError, "invalid character"); } if (!(flags & FWIDTH)) { |