diff options
author | H. Peter Anvin <hpa@zytor.com> | 2009-07-14 14:47:41 -0400 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2009-07-14 14:47:41 -0400 |
commit | bf0247af7a7eac9ea50687148935c7d9af32577c (patch) | |
tree | bf66267ed68fa83c193066bc5a13885989395a5a /nasm.c | |
parent | 68bec0872f6274d74202f6d56e7709b557b1e124 (diff) | |
download | nasm-bf0247af7a7eac9ea50687148935c7d9af32577c.tar.gz nasm-bf0247af7a7eac9ea50687148935c7d9af32577c.tar.bz2 nasm-bf0247af7a7eac9ea50687148935c7d9af32577c.zip |
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>
Diffstat (limited to 'nasm.c')
-rw-r--r-- | nasm.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -473,10 +473,12 @@ int main(int argc, char **argv) } } - fclose(ofile); - if (ofile && terminate_after_phase) - remove(outname); - ofile = NULL; + if (ofile) { + fclose(ofile); + if (terminate_after_phase) + remove(outname); + ofile = NULL; + } } break; } |