diff options
| author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-12-12 14:53:49 +0000 |
|---|---|---|
| committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-12-12 14:53:49 +0000 |
| commit | 611158b722092fe7a48c222eedf6e2becf6fc673 (patch) | |
| tree | f77dcfd135b718cd74af92291931d98d23c6c093 /pack.c | |
| parent | 1a029390588a080b96cde5d8e65c25fef9025216 (diff) | |
merges r20580 from trunk into ruby_1_9_1.
* pack.c (pack_pack): fixed length for odd length string.
[ruby-dev:37283]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@20672 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'pack.c')
| -rw-r--r-- | pack.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -620,7 +620,7 @@ pack_pack(VALUE ary, VALUE fmt) long i, j = 0; if (len > plen) { - j = (len - plen + 1)/2; + j = (len + 1) / 2 - (plen + 1) / 2; len = plen; } for (i=0; i++ < len; ptr++) { @@ -651,7 +651,7 @@ pack_pack(VALUE ary, VALUE fmt) long i, j = 0; if (len > plen) { - j = (len - plen + 1)/2; + j = (len + 1) / 2 - (plen + 1) / 2; len = plen; } for (i=0; i++ < len; ptr++) { |
