diff options
author | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-07-17 11:36:54 +0000 |
---|---|---|
committer | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-07-17 11:36:54 +0000 |
commit | a87a4b2a29ad7dee09b29064549ab9aa9620c286 (patch) | |
tree | 4c2c245fbe88666bf25ac2ba0e2ec0c9cbc780b9 /pack.c | |
parent | 08d76518f6a9b17e46a5a5fb8af241386e516635 (diff) | |
download | ruby-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.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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; |