1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* sprintf.c (rb_str_format): size_t returned from strlen() can be

unsigned.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15697 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2008-03-05 15:34:02 +00:00
parent 79cdf2ffa2
commit 8c889459cf
2 changed files with 6 additions and 1 deletions

View file

@ -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.

View file

@ -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));