THRIFT-2070 Improper `HexChar' and 'HexVal' implementation in TJSONProtocol.cs
authorJens Geyer <jensg@apache.org>
Fri, 28 Jun 2013 19:48:02 +0000 (21:48 +0200)
committerJens Geyer <jensg@apache.org>
Fri, 28 Jun 2013 19:48:02 +0000 (21:48 +0200)
Patch: Yousong Zhou

lib/csharp/src/Protocol/TJSONProtocol.cs

index f583781..3b27d30 100644 (file)
@@ -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');
                        }
                }