diff options
| author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-03-05 15:34:02 +0000 |
|---|---|---|
| committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-03-05 15:34:02 +0000 |
| commit | 7937cb7ca07301a437c526cfe914c8166b31e3a7 (patch) | |
| tree | 77c97f695f7b50d2ef5f612e82798633a91b4ad3 | |
| parent | 828cff4f2ce585946749d35f9f45976c7e9dc694 (diff) | |
| download | ruby-7937cb7ca07301a437c526cfe914c8166b31e3a7.tar.gz ruby-7937cb7ca07301a437c526cfe914c8166b31e3a7.tar.xz ruby-7937cb7ca07301a437c526cfe914c8166b31e3a7.zip | |
* sprintf.c (rb_str_format): size_t returned from strlen() can be
unsigned.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15697 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 5 | ||||
| -rw-r--r-- | sprintf.c | 2 |
2 files changed, 6 insertions, 1 deletions
@@ -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. @@ -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)); |
