summaryrefslogtreecommitdiff
path: root/nasm.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2009-07-14 14:47:41 -0400
committerH. Peter Anvin <hpa@zytor.com>2009-07-14 14:47:41 -0400
commitbf0247af7a7eac9ea50687148935c7d9af32577c (patch)
treebf66267ed68fa83c193066bc5a13885989395a5a /nasm.c
parent68bec0872f6274d74202f6d56e7709b557b1e124 (diff)
downloadnasm-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.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/nasm.c b/nasm.c
index 398472d..ab04a11 100644
--- a/nasm.c
+++ b/nasm.c
@@ -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;
}