Fix fgets native not setting the plugin buffer on null result

This commit is contained in:
Arkshine 2015-04-12 20:20:21 +02:00
parent d4bfebec22
commit 10c0204b16

View File

@ -622,10 +622,7 @@ static cell AMX_NATIVE_CALL amx_fgets(AMX *amx, cell *params)
static char buffer[4096];
buffer[0] = '\0';
if (!fp->ReadLine(buffer, sizeof(buffer) - 1))
{
return 0;
}
fp->ReadLine(buffer, sizeof(buffer) - 1);
return set_amxstring_utf8(amx, params[2], buffer, strlen(buffer), params[3] + 1); // + EOS
}