aboutsummaryrefslogtreecommitdiffstats
path: root/pack.c
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-10-17 12:52:26 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-10-17 12:52:26 +0000
commit50650bb338744994c3c927f73fa6cb071e6f676a (patch)
tree8b4d68342caa80ca1cbe543ac1cea4e7acecd5c1 /pack.c
parent0d4185f30e360b078d663acd8f4dfda95fe2aae9 (diff)
downloadruby-50650bb338744994c3c927f73fa6cb071e6f676a.tar.gz
* pack.c (pack_unpack): Add casts for char references for 'b' and 'h'.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47998 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 d9283b7ea6..0cf2dc37b7 100644
--- a/pack.c
+++ b/pack.c
@@ -1343,7 +1343,7 @@ pack_unpack(VALUE str, VALUE fmt)
t = RSTRING_PTR(bitstr);
for (i=0; i<len; i++) {
if (i & 7) bits >>= 1;
- else bits = *s++;
+ else bits = (unsigned char)*s++;
*t++ = (bits & 1) ? '1' : '0';
}
}
@@ -1385,7 +1385,7 @@ pack_unpack(VALUE str, VALUE fmt)
if (i & 1)
bits >>= 4;
else
- bits = *s++;
+ bits = (unsigned char)*s++;
*t++ = hexdigits[bits & 15];
}
}