From 964823b332926bcf3d757f212f1dbf38077b5fa2 Mon Sep 17 00:00:00 2001 From: Andrey Date: Mon, 25 Apr 2022 23:35:54 +0300 Subject: [PATCH] linux PIString fix --- libs/main/core/pistring.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libs/main/core/pistring.cpp b/libs/main/core/pistring.cpp index 51b239c8..781f3cc2 100644 --- a/libs/main/core/pistring.cpp +++ b/libs/main/core/pistring.cpp @@ -233,18 +233,18 @@ void PIString::appendFromChars(const char * c, int s, const char * codepage) { # else mbstate_t state; memset(&state, 0, sizeof(state)); - char * pc; + const char ** pc; if (s > 0) { char c_ [s+1]; memcpy(c_, c, s); c_[s] = '\0'; - pc = c_; + pc = &c_; } else { - pc = c; + pc = &c; } - size_t len = mbsrtowcs(NULL, (const char**)&pc, 0, &state); + size_t len = mbsrtowcs(NULL, pc, 0, &state); wchar_t wstr[len+1]; - mbsrtowcs(&wstr[0], (const char**)&pc, len+1, &state); + mbsrtowcs(&wstr[0], pc, len+1, &state); enlarge(len); for (size_t i=0; i