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 && terminate_after_phase)
remove(outname);
ofile = NULL;
if (ofile) {
fclose(ofile);
if (terminate_after_phase)
remove(outname);
ofile = NULL;
}
}
break;
}