THRIFT-1183. rb: Pure-ruby CompactProtocol raises ArgumentError when deserializing...
authorBryan Duxbury <bryanduxbury@apache.org>
Wed, 1 Jun 2011 17:23:33 +0000 (17:23 +0000)
committerBryan Duxbury <bryanduxbury@apache.org>
Wed, 1 Jun 2011 17:23:33 +0000 (17:23 +0000)
Use #ord to ensure we get back an int

Patch: Ilya Maykov

git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1130236 13f79535-47bb-0310-9956-ffa450edef68

lib/rb/lib/thrift/protocol/compact_protocol.rb

index 3be2a90..f5108ad 100644 (file)
@@ -303,7 +303,7 @@ module Thrift
 
     def read_byte
       dat = trans.read_all(1)
-      val = dat[0]
+      val = dat[0].ord
       if (val > 0x7f)
         val = 0 - ((val - 1) ^ 0xff)
       end