diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-11-15 16:45:03 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-11-15 16:45:03 +0000 |
commit | 67d54f209d28019cc5d8b332706dd9950b56bdc7 (patch) | |
tree | 19afa15048b4c73f2a701a9b1ebf09a8c82ef203 /string.c | |
parent | 30b3ce3445f5cbf94080a8408b83eaafaa264baa (diff) | |
download | ruby-67d54f209d28019cc5d8b332706dd9950b56bdc7.tar.gz |
* array.c (rb_ary_update): pedantic check to detect
rb_ary_to_ary() to modify the receiver. [ruby-dev:24861]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7273 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r-- | string.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -4491,9 +4491,10 @@ rb_str_justify(argc, argv, str, jflag) res = rb_str_new5(str, 0, width); if (argc == 2) { StringValue(pad); - if (RSTRING(pad)->len > 0) { - f = RSTRING(pad)->ptr; - flen = RSTRING(pad)->len; + f = RSTRING(pad)->ptr; + flen = RSTRING(pad)->len; + if (flen == 0) { + rb_raise(rb_eArgError, "zero width padding"); } } p = RSTRING(res)->ptr; |