fixed fclose bug (NiLuJe)

This commit is contained in:
David Anderson 2006-03-01 20:59:08 +00:00
parent a9cdb2b48e
commit 2d6c06b82f

View File

@ -633,17 +633,14 @@ static cell AMX_NATIVE_CALL amx_feof(AMX *amx, cell *params)
static cell AMX_NATIVE_CALL amx_fclose(AMX *amx, cell *params) static cell AMX_NATIVE_CALL amx_fclose(AMX *amx, cell *params)
{ {
cell *addr = get_amxaddr(amx, params[1]); FILE *fp = (FILE *)params[1];
if (*addr)
{
FILE *fp = (FILE *)*addr;
fclose(fp);
*addr = 0;
if (!fp)
return 1; return 1;
}
return 0; fclose(fp);
return 1;
} }
static cell AMX_NATIVE_CALL amx_filesize(AMX *amx, cell *params) static cell AMX_NATIVE_CALL amx_filesize(AMX *amx, cell *params)