* sprintf.c (rb_str_format): space flag is in effect for Inf/NaN too.

[ruby-dev:34002]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15720 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2008-03-06 08:26:55 +00:00
parent fe2a671fdb
commit ec2205b205
2 changed files with 7 additions and 0 deletions

View File

@ -1,3 +1,8 @@
Thu Mar 6 17:26:53 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* sprintf.c (rb_str_format): space flag is in effect for Inf/NaN too.
[ruby-dev:34002]
Thu Mar 6 15:44:20 2008 NAKAMURA Usaku <usa@ruby-lang.org>
* sprintf.c (rb_str_format): casting double to long is undefined

View File

@ -794,6 +794,8 @@ rb_str_format(int argc, const VALUE *argv, VALUE fmt)
buf[blen + need - strlen(expr) - 1] = '-';
else if (flags & FPLUS)
buf[blen + need - strlen(expr) - 1] = '+';
else if ((flags & FSPACE) && need > width)
blen++;
strncpy(&buf[blen + need - strlen(expr)], expr,
strlen(expr));
}