From b0d2954a564f858ab225fd181e7ab6ec54f6f5fa Mon Sep 17 00:00:00 2001 From: Adam Honse Date: Mon, 29 Jul 2024 21:24:13 -0500 Subject: [PATCH] Fix possible loss of data warning in StringUtils.cpp --- StringUtils.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/StringUtils.cpp b/StringUtils.cpp index 6b321fb4..c6ce5795 100644 --- a/StringUtils.cpp +++ b/StringUtils.cpp @@ -20,12 +20,12 @@ const char* StringUtils::wchar_to_char(const wchar_t* pwchar) } // get the number of characters in the string. int currentCharIndex = 0; - char currentChar = pwchar[currentCharIndex]; + char currentChar = (char)pwchar[currentCharIndex]; while (currentChar != '\0') { currentCharIndex++; - currentChar = pwchar[currentCharIndex]; + currentChar = (char)pwchar[currentCharIndex]; } const int charCount = currentCharIndex + 1; @@ -36,7 +36,7 @@ const char* StringUtils::wchar_to_char(const wchar_t* pwchar) for (int i = 0; i < charCount; i++) { // convert to char (1 byte) - char character = pwchar[i]; + char character = (char)pwchar[i]; *filePathC = character;