]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
chat : fix debug build assertion in trim function (#15520)
authorLaffeyNyaa <redacted>
Sat, 23 Aug 2025 08:38:30 +0000 (16:38 +0800)
committerGitHub <redacted>
Sat, 23 Aug 2025 08:38:30 +0000 (10:38 +0200)
src/llama-chat.cpp

index 0a96a9a579e26773fc5b7290d6d5d41a44b0b6b2..4d6fdf822619bac1c01c5bd8a1b9d5235dee2f4f 100644 (file)
 static std::string trim(const std::string & str) {
     size_t start = 0;
     size_t end = str.size();
-    while (start < end && isspace(str[start])) {
+    while (start < end && isspace(static_cast<unsigned char>(str[start]))) {
         start += 1;
     }
-    while (end > start && isspace(str[end - 1])) {
+    while (end > start && isspace(static_cast<unsigned char>(str[end - 1]))) {
         end -= 1;
     }
     return str.substr(start, end - start);