From 90c4fc1db16d04b3da5e8e85fe2b75f688c62c57 Mon Sep 17 00:00:00 2001 From: Arkshine Date: Tue, 27 May 2014 13:49:59 +0200 Subject: [PATCH] Fix an unicode issue with amx_SetStringOld. --- amxmodx/CForward.cpp | 4 ++-- amxmodx/amxmodx.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/amxmodx/CForward.cpp b/amxmodx/CForward.cpp index aa0c4230..20656e63 100755 --- a/amxmodx/CForward.cpp +++ b/amxmodx/CForward.cpp @@ -100,7 +100,7 @@ cell CForward::execute(cell *params, ForwardPreparedArray *preparedArrays) if (!str) str = ""; amx_Allot(iter->pPlugin->getAMX(), (m_ParamTypes[i] == FP_STRING) ? strlen(str) + 1 : STRINGEX_MAXLENGTH, &realParams[i], &tmp); - amx_SetStringOld(tmp, str, 0, 0); + amx_SetStringOld(tmp, str, 0, 1); physAddrs[i] = tmp; } else if (m_ParamTypes[i] == FP_ARRAY) @@ -277,7 +277,7 @@ cell CSPForward::execute(cell *params, ForwardPreparedArray *preparedArrays) str = ""; cell *tmp; amx_Allot(m_Amx, (m_ParamTypes[i] == FP_STRING) ? strlen(str) + 1 : STRINGEX_MAXLENGTH, &realParams[i], &tmp); - amx_SetStringOld(tmp, str, 0, 0); + amx_SetStringOld(tmp, str, 0, 1); physAddrs[i] = tmp; } else if (m_ParamTypes[i] == FP_ARRAY) diff --git a/amxmodx/amxmodx.cpp b/amxmodx/amxmodx.cpp index 8d0c644d..1807ae12 100755 --- a/amxmodx/amxmodx.cpp +++ b/amxmodx/amxmodx.cpp @@ -4019,7 +4019,7 @@ static cell AMX_NATIVE_CALL callfunc_push_str(AMX *amx, cell *params) // copy it to the allocated memory // we assume it's unpacked // :NOTE: 4th parameter use_wchar since Small Abstract Machine 2.5.0 - amx_SetStringOld(phys_addr, str, 0, 0); + amx_SetStringOld(phys_addr, str, 0, 1); // push the address and set the reference flag so that memory is released after function call. g_CallFunc_ParamInfo[g_CallFunc_CurParam].flags = CALLFUNC_FLAG_BYREF;