Add new string natives/stocks, make some UTF-8 safe (bug 6110, r=ds)

This commit is contained in:
Arkshine
2014-04-30 09:33:03 +02:00
parent c99a518ba4
commit a86ca1491f
12 changed files with 1560 additions and 161 deletions

View File

@@ -137,13 +137,14 @@ static cell AMX_NATIVE_CALL ReadPackString(AMX* amx, cell* params)
}
const char *str;
if (!(str = d->ReadString(NULL)))
size_t len;
if (!(str = d->ReadString(&len)))
{
LogError(amx, AMX_ERR_NATIVE, "DataPack operation is out of bounds.");
return 0;
}
return set_amxstring(amx, params[2], str, params[3]);
return set_amxstring_utf8(amx, params[2], str, len, params[3] + 1); // + EOS
}
static cell AMX_NATIVE_CALL ResetPack(AMX* amx, cell* params)