Skip to content

Commit

Permalink
Fixed bad escaping of control characters
Browse files Browse the repository at this point in the history
  • Loading branch information
mxmauro committed Jan 27, 2022
1 parent 987900f commit 7e72690
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions LightJSonBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,7 @@ BOOL CLightJSonBuilder::EscapeString(_Inout_ CStringA &cStrA, _In_ LPCSTR szValu
break;

default:
if (cStrA.AppendFormat("\\u%04lu", (ULONG) * ((LPBYTE)szValueA)) == FALSE)
if (cStrA.AppendFormat("\\u%04lX", (ULONG)*((LPBYTE)szValueA)) == FALSE)
return FALSE;
break;
}
Expand Down Expand Up @@ -789,7 +789,7 @@ BOOL CLightJSonBuilder::EscapeString(_Inout_ CStringA &cStrA, _In_ LPCWSTR szVal
default:
if (*szValueW < 32)
{
if (cStrA.AppendFormat("\\u%04lu", (ULONG)*szValueW) == FALSE)
if (cStrA.AppendFormat("\\u%04lX", (ULONG)*szValueW) == FALSE)
return FALSE;
}
else
Expand Down

0 comments on commit 7e72690

Please sign in to comment.