From: Jens Geyer Date: Fri, 28 Jun 2013 19:48:02 +0000 (+0200) Subject: THRIFT-2070 Improper `HexChar' and 'HexVal' implementation in TJSONProtocol.cs X-Git-Tag: 0.9.1~55 X-Git-Url: https://source.supwisdom.com/gerrit/gitweb?a=commitdiff_plain;h=e5bfd4c285c24c06525b9266a3d3acf8bdb42648;p=common%2Fthrift.git THRIFT-2070 Improper `HexChar' and 'HexVal' implementation in TJSONProtocol.cs Patch: Yousong Zhou --- diff --git a/lib/csharp/src/Protocol/TJSONProtocol.cs b/lib/csharp/src/Protocol/TJSONProtocol.cs index f5837816..3b27d306 100644 --- a/lib/csharp/src/Protocol/TJSONProtocol.cs +++ b/lib/csharp/src/Protocol/TJSONProtocol.cs @@ -407,6 +407,7 @@ namespace Thrift.Protocol } else if ((ch >= 'a') && (ch <= 'f')) { + ch += 10; return (byte)((char)ch - 'a'); } else @@ -428,6 +429,7 @@ namespace Thrift.Protocol } else { + val -= 10; return (byte)((char)val + 'a'); } }