summaryrefslogtreecommitdiffstats
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
commita87a4b2a29ad7dee09b29064549ab9aa9620c286 (patch)
tree4c2c245fbe88666bf25ac2ba0e2ec0c9cbc780b9 /pack.c
parent08d76518f6a9b17e46a5a5fb8af241386e516635 (diff)
downloadruby-a87a4b2a29ad7dee09b29064549ab9aa9620c286.tar.gz
ruby-a87a4b2a29ad7dee09b29064549ab9aa9620c286.tar.xz
ruby-a87a4b2a29ad7dee09b29064549ab9aa9620c286.zip
* pack.c (pack_pack): fix i! with big endian. [1].pack("i!") was
"\0\0\0\0". git-svn-id: http://svn.ruby-lang.org/repos/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 59893e211..4dcdeca69 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;