aboutsummaryrefslogtreecommitdiffstats
path: root/sprintf.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-10-09 18:41:35 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-10-09 18:41:35 +0000
commit94355e2984dad584f409d732fea4310bbbd3588f (patch)
treed019e96a644151602262533c6ab22292e6258e52 /sprintf.c
parent017ff9bfa2daadb7c27953eb1ae70c2833dfa80c (diff)
downloadruby-94355e2984dad584f409d732fea4310bbbd3588f.tar.gz
* 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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sprintf.c b/sprintf.c
index 0085cfc176..34152b1704 100644
--- a/sprintf.c
+++ b/sprintf.c
@@ -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)) {