aboutsummaryrefslogtreecommitdiffstats
path: root/sprintf.c
diff options
context:
space:
mode:
Diffstat (limited to 'sprintf.c')
-rw-r--r--sprintf.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sprintf.c b/sprintf.c
index 74229cc2d7..0d685ddbaf 100644
--- a/sprintf.c
+++ b/sprintf.c
@@ -648,6 +648,7 @@ rb_str_format(int argc, const VALUE *argv, VALUE fmt)
if (width < 0) {
flags |= FMINUS;
width = -width;
+ if (width < 0) rb_raise(rb_eArgError, "width too big");
}
p++;
goto retry;