summaryrefslogtreecommitdiff
path: root/pack.c
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-02-19 08:25:45 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-02-19 08:25:45 +0000
commitd7f27048486999f5d8c81223c0f10e3243487bbb (patch)
treec89446613ce6588d723b25ed5d64bd849206a0e8 /pack.c
parent52b49b399e0b119e63cc3f918485ece23c097de6 (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_6@22444 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 97c52e433e..13c282af9a 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++) {