diff --git a/src/kits/locale/HashMapCatalog.cpp b/src/kits/locale/HashMapCatalog.cpp index cd3bcfc6e1..71ab423837 100644 --- a/src/kits/locale/HashMapCatalog.cpp +++ b/src/kits/locale/HashMapCatalog.cpp @@ -161,7 +161,11 @@ parseQuotedChars(BString& stringToParse) *out = '"'; else if (*in == 'x') { // Parse the 2-digit hex integer that follows - unsigned int hexchar = strtoul(in + 1, NULL, 16); + char tmp[3]; + tmp[0] = *(in+1); + tmp[1] = *(in+2); + tmp[3] = '\0'; + unsigned int hexchar = strtoul(tmp, NULL, 16); *out = hexchar; // skip the number in += 2; diff --git a/src/tools/locale/HashMapCatalog.cpp b/src/tools/locale/HashMapCatalog.cpp index 4ce14a1d3f..7ef31c327b 100644 --- a/src/tools/locale/HashMapCatalog.cpp +++ b/src/tools/locale/HashMapCatalog.cpp @@ -165,7 +165,11 @@ parseQuotedChars(BString& stringToParse) *out = '"'; else if (*in == 'x') { // Parse the 2-digit hex integer that follows - unsigned int hexchar = strtoul(in + 1, NULL, 16); + char tmp[3]; + tmp[0] = *(in+1); + tmp[1] = *(in+2); + tmp[3] = '\0'; + unsigned int hexchar = strtoul(tmp, NULL, 16); *out = hexchar; // skip the number in += 2;