From 1f45a8353fbab9b0f913d17919661bc6afadeaf9 Mon Sep 17 00:00:00 2001 From: "Dan S. Camper" Date: Mon, 13 May 2024 07:51:59 -0500 Subject: [PATCH] HPCC-31820 Unicode regex errors displayed with garbage at the end --- rtl/eclrtl/eclregex.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rtl/eclrtl/eclregex.cpp b/rtl/eclrtl/eclregex.cpp index 0ba83b59123..eaf229f2007 100644 --- a/rtl/eclrtl/eclregex.cpp +++ b/rtl/eclrtl/eclregex.cpp @@ -110,7 +110,7 @@ static void failWithUPCRE2Error(int errCode, const char * msgPrefix, const UChar char * regexStr = nullptr; unsigned regexStrLen; rtlUnicodeToEscapedStrX(regexStrLen, regexStr, rtlUnicodeStrlen(regex), regex); - regexPattern += regexStr; + regexPattern = std::string(regexStr, regexStrLen); rtlFree(regexStr); } failWithPCRE2Error(errCode, msgPrefix, regexPattern.c_str(), errOffset);