Permalink
Browse files

Treat all small ints as unsigned

  • Loading branch information...
1 parent 94c7138 commit 05344ad23172ef015ed7b9b23c23886db62036a3 @tmm1 tmm1 committed Dec 10, 2011
Showing with 3 additions and 2 deletions.
  1. +1 −1 ext/bert/c/decode.c
  2. +2 −1 test/bert_test.rb
View
@@ -333,7 +333,7 @@ static VALUE bert_read_atom(struct bert_buf *buf)
static VALUE bert_read_sint(struct bert_buf *buf)
{
bert_buf_ensure(buf, 1);
- return INT2FIX((int8_t)bert_buf_read8(buf));
+ return INT2FIX((uint8_t)bert_buf_read8(buf));
}
static VALUE bert_read_int(struct bert_buf *buf)
View
@@ -44,7 +44,8 @@ class BertTest < Test::Unit::TestCase
dd << {:a => 1, :b => 2}
dd << Time.now
dd << /^c(a)t$/i
-
+
+ dd << 178
dd << 256**256 - 1
dd << :true

0 comments on commit 05344ad

Please sign in to comment.