0
0
mirror of https://github.com/netwide-assembler/nasm.git synced 2025-10-10 00:25:06 -04:00

Don't try to fclose() the output if ofile is NULL

ofile == NULL means no output file is open, so don't try to close the
output file if that is true.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
This commit is contained in:
H. Peter Anvin
2009-07-14 14:47:41 -04:00
parent 68bec0872f
commit bf0247af7a

10
nasm.c
View File

@@ -473,10 +473,12 @@ int main(int argc, char **argv)
} }
} }
fclose(ofile); if (ofile) {
if (ofile && terminate_after_phase) fclose(ofile);
remove(outname); if (terminate_after_phase)
ofile = NULL; remove(outname);
ofile = NULL;
}
} }
break; break;
} }