summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--sprintf.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index a5a977c09c..00aad39c73 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Thu Mar 6 00:34:00 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * sprintf.c (rb_str_format): size_t returned from strlen() can be
+ unsigned.
+
Thu Mar 6 00:31:39 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* struct.c (make_struct): preserve encoding of struct name.
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));