summaryrefslogtreecommitdiff
path: root/sprintf.c
diff options
context:
space:
mode:
Diffstat (limited to 'sprintf.c')
-rw-r--r--sprintf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sprintf.c b/sprintf.c
index a100946aa7..53d2d8bfc4 100644
--- a/sprintf.c
+++ b/sprintf.c
@@ -802,7 +802,7 @@ rb_str_format(int argc, const VALUE *argv, VALUE fmt)
blen++;
need--;
}
- while (need-- - strlen(expr) > 0) {
+ while (need-- > strlen(expr)) {
buf[blen++] = '0';
}
strncpy(&buf[blen], expr, strlen(expr));