Fixed issue 6: range check bug

git-svn-id: https://rapidjson.googlecode.com/svn/trunk@51 c5894555-1306-4e8d-425f-1f6f381ee07c
This commit is contained in:
miloyip@gmail.com 2011-12-06 04:28:36 +00:00
parent bf8fcd19c1
commit bedeb0d8ea

View File

@ -418,7 +418,7 @@ private:
if (c == '\\') { // Escape if (c == '\\') { // Escape
is.Take(); is.Take();
Ch e = is.Take(); Ch e = is.Take();
if ((sizeof(Ch) == 1 || e < 256) && escape[(unsigned char)e]) if ((sizeof(Ch) == 1 || unsigned(e) < 256) && escape[(unsigned char)e])
os.Put(escape[(unsigned char)e]); os.Put(escape[(unsigned char)e]);
else if (e == 'u') { // Unicode else if (e == 'u') { // Unicode
unsigned codepoint = ParseHex4(is); unsigned codepoint = ParseHex4(is);