From 2d6c06b82f7f28f2466e99ffb331969bdbb5d4ba Mon Sep 17 00:00:00 2001 From: David Anderson Date: Wed, 1 Mar 2006 20:59:08 +0000 Subject: [PATCH] fixed fclose bug (NiLuJe) --- amxmodx/file.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/amxmodx/file.cpp b/amxmodx/file.cpp index d4c83b26..848538b0 100755 --- a/amxmodx/file.cpp +++ b/amxmodx/file.cpp @@ -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) { - cell *addr = get_amxaddr(amx, params[1]); - if (*addr) - { - FILE *fp = (FILE *)*addr; - fclose(fp); - *addr = 0; + FILE *fp = (FILE *)params[1]; + if (!fp) return 1; - } - return 0; + fclose(fp); + + return 1; } static cell AMX_NATIVE_CALL amx_filesize(AMX *amx, cell *params)