From 9d5f82ed6c1b2545ccd6fb4a08c641136f0371db Mon Sep 17 00:00:00 2001 From: Daniel_Cortez Date: Fri, 7 Sep 2018 02:06:06 +0700 Subject: [PATCH] amxaux.c: Get rid of a goto statement --- source/amx/amxaux.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/source/amx/amxaux.c b/source/amx/amxaux.c index 762b5b5..10a92ea 100644 --- a/source/amx/amxaux.c +++ b/source/amx/amxaux.c @@ -57,15 +57,16 @@ int AMXAPI aux_LoadProgram(AMX *amx, char *filename, void *memblock) return AMX_ERR_NOTFOUND; size = fread(&hdr, sizeof hdr, 1, fp); if (size < 1) { -err_format: fclose(fp); return AMX_ERR_FORMAT; } /* if */ amx_Align16(&hdr.magic); amx_Align32((uint32_t *)&hdr.size); amx_Align32((uint32_t *)&hdr.stp); - if (hdr.magic != AMX_MAGIC) - goto err_format; + if (hdr.magic != AMX_MAGIC) { + fclose(fp); + return AMX_ERR_FORMAT; + } /* if */ /* allocate the memblock if it is NULL */ didalloc = 0;