diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-07-23 09:44:48 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-07-23 09:44:48 +0000 |
commit | c96feb9bb1b8fd0fce0c1c18720ae03646f5a57f (patch) | |
tree | 0ac45ec4fdf12039e129c5884f4821e1148d6c2a /sprintf.c | |
parent | 1286a06f9f234941b3c72c1a3d5aa053d1c87bd8 (diff) | |
download | ruby-c96feb9bb1b8fd0fce0c1c18720ae03646f5a57f.tar.gz |
sprintf.c: width too big
* sprintf.c (rb_str_format): explicitly reject too big negative
width, instead of an empty string.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59410 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'sprintf.c')
-rw-r--r-- | sprintf.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -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; |