aboutsummaryrefslogtreecommitdiffstats
path: root/sprintf.c
diff options
context:
space:
mode:
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)) {