mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
sprintf.c: remove redundant condition
* sprintf.c (rb_str_format): when `t + 1 == end` (or `t < end`), `*t == '%'` is always true. [ruby-core:80153] [Bug #13315] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58898 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
a77cb8c80f
commit
c854fde373
1 changed files with 1 additions and 2 deletions
|
@ -521,8 +521,7 @@ rb_str_format(int argc, const VALUE *argv, VALUE fmt)
|
|||
|
||||
for (t = p; t < end && *t != '%'; t++) ;
|
||||
if (t + 1 == end) {
|
||||
if (*t == '%') rb_raise(rb_eArgError, "incomplete format specifier");
|
||||
++t;
|
||||
rb_raise(rb_eArgError, "incomplete format specifier");
|
||||
}
|
||||
PUSH(p, t - p);
|
||||
if (coderange != ENC_CODERANGE_BROKEN && scanned < blen) {
|
||||
|
|
Loading…
Reference in a new issue