summaryrefslogtreecommitdiff
path: root/pack.c
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-02-19 08:26:33 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-02-19 08:26:33 +0000
commit8d81fc6df66ab4d839ceaf94f274da36b7fab295 (patch)
treee316707fad8091ba491bc7f5855c641955b45d96 /pack.c
parentfe9c4e615b69d06db554cf1116560b353b96a9ed (diff)
merge revision(s) 20580:
* pack.c (pack_pack): fixed length for odd length string. [ruby-dev:37283] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@22446 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'pack.c')
-rw-r--r--pack.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/pack.c b/pack.c
index 8e58364024..d0fdd75cd5 100644
--- a/pack.c
+++ b/pack.c
@@ -610,7 +610,7 @@ pack_pack(ary, 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++) {
@@ -641,7 +641,7 @@ pack_pack(ary, 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++) {