From 7e726907f8ea2fb84c91475577217865834f42c9 Mon Sep 17 00:00:00 2001 From: Mauro Leggieri Date: Thu, 27 Jan 2022 11:41:52 -0300 Subject: [PATCH] Fixed bad escaping of control characters --- LightJSonBuilder.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/LightJSonBuilder.cpp b/LightJSonBuilder.cpp index f84951d..466a0df 100644 --- a/LightJSonBuilder.cpp +++ b/LightJSonBuilder.cpp @@ -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; } @@ -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