summaryrefslogtreecommitdiff
path: root/pack.c
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-07-17 11:36:54 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-07-17 11:36:54 +0000
commit871c83dddf8132d2668249cc0917320bb86712fd (patch)
tree4c2c245fbe88666bf25ac2ba0e2ec0c9cbc780b9 /pack.c
parentfae330b3b90572ef55f6ffd9b67c2c6fa7f5f526 (diff)
* pack.c (pack_pack): fix i! with big endian. [1].pack("i!") was
"\0\0\0\0". git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18105 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 59893e2116..4dcdeca693 100644
--- a/pack.c
+++ b/pack.c
@@ -691,11 +691,11 @@ pack_pack(VALUE ary, VALUE fmt)
case 'i': /* signed int */
case 'I': /* unsigned int */
while (len-- > 0) {
- long i;
+ int i;
from = NEXTFROM;
i = num2i32(from);
- rb_str_buf_cat(res, OFF32(&i), NATINT_LEN(int,4));
+ rb_str_buf_cat(res, (char*)&i, sizeof(int));
}
break;