summaryrefslogtreecommitdiff
path: root/sprintf.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-26 06:39:49 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-26 06:39:49 +0000
commitc854fde373bf5f08c8a906e2bad00b6ed4d80ffc (patch)
tree8fd126e4594e7dfb69536bcf74c0dec44872e832 /sprintf.c
parenta77cb8c80f7a1bb849740bfdfaf551123715f04c (diff)
downloadruby-c854fde373bf5f08c8a906e2bad00b6ed4d80ffc.tar.gz
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
Diffstat (limited to 'sprintf.c')
-rw-r--r--sprintf.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/sprintf.c b/sprintf.c
index 8488d58cbd..74229cc2d7 100644
--- a/sprintf.c
+++ b/sprintf.c
@@ -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) {