Code Review
/
common
/
thrift.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
review
|
tree
raw
|
patch
| inline |
side by side
(parent:
ae7f7fa
)
THRIFT-977. cpp: Hex Conversion Bug in C++ TJSONProtocol
author
Bryan Duxbury
<bryanduxbury@apache.org>
Wed, 3 Nov 2010 17:57:38 +0000
(17:57 +0000)
committer
Bryan Duxbury
<bryanduxbury@apache.org>
Wed, 3 Nov 2010 17:57:38 +0000
(17:57 +0000)
This patch fixes a silly bug in hex-to-int conversion in TSJONProtocol.
Patch: Aravind Narayanan
git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@
1030576
13f79535
-47bb-0310-9956-
ffa450edef68
lib/cpp/src/protocol/TJSONProtocol.cpp
patch
|
blob
|
history
diff --git
a/lib/cpp/src/protocol/TJSONProtocol.cpp
b/lib/cpp/src/protocol/TJSONProtocol.cpp
index
9859c0f
..
5b0b18d
100644
(file)
--- a/
lib/cpp/src/protocol/TJSONProtocol.cpp
+++ b/
lib/cpp/src/protocol/TJSONProtocol.cpp
@@
-194,7
+194,7
@@
static uint8_t hexVal(uint8_t ch) {
return ch - '0';
}
else if ((ch >= 'a') && (ch <= 'f')) {
- return ch - 'a';
+ return ch - 'a'
+ 10
;
}
else {
throw TProtocolException(TProtocolException::INVALID_DATA,
@@
-211,7
+211,7
@@
static uint8_t hexChar(uint8_t val) {
return val + '0';
}
else {
- return val + 'a';
+ return val
- 10
+ 'a';
}
}