Skip to content

Commit

Permalink
backport r142424 and r143432
Browse files Browse the repository at this point in the history
svn path=/branches/monotouch-1-0/mcs/; revision=144381
  • Loading branch information
jbevain committed Oct 19, 2009
1 parent ea07ea7 commit c5d7220
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 4 additions & 0 deletions mcs/class/System.Json/System.Json/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2009-10-05 Atsushi Enomoto <atsushi@ximian.com>

* JsonReader.cs : \uXXXX parser was totally wrong, giving wrong #.

2009-09-22 Atsushi Enomoto <atsushi@ximian.com>

* JsonValue.cs, JsonReader.cs, JsonPrimitive.cs :
Expand Down
7 changes: 4 additions & 3 deletions mcs/class/System.Json/System.Json/JsonReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -279,13 +279,14 @@ string ReadStringLiteral ()
case 'u':
ushort cp = 0;
for (int i = 0; i < 4; i++) {
cp <<= 4;
if ((c = ReadChar ()) < 0)
throw JsonError ("Incomplete unicode character escape literal");
if ('0' >= c && c <= '9')
if ('0' <= c && c <= '9')
cp += (ushort) (c - '0');
if ('A' >= c && c <= 'F')
if ('A' <= c && c <= 'F')
cp += (ushort) (c - 'A' + 10);
if ('a' >= c && c <= 'f')
if ('a' <= c && c <= 'f')
cp += (ushort) (c - 'a' + 10);
}
vb.Append ((char) cp);
Expand Down

0 comments on commit c5d7220

Please sign in to comment.