Unspecified files are null strings, not null pointers

We use empty strings, not null pointers, for unspecified files, so
there is no need to compare them for nullness.
This commit is contained in:
H. Peter Anvin 2007-10-01 11:28:32 -07:00
parent 59ddd26aac
commit c147da0d28

6
nasm.c
View File

@ -783,13 +783,11 @@ static void parse_cmdline(int argc, char **argv)
/* Look for basic command line typos. This definitely doesn't
catch all errors, but it might help cases of fumbled fingers. */
if ((errname && !strcmp(inname, errname)) ||
(outname && !strcmp(inname, outname)) ||
(listname && !strcmp(inname, listname))) {
if (!strcmp(inname, errname) || !strcmp(inname, outname) ||
!strcmp(inname, listname))
report_error(ERR_FATAL | ERR_NOFILE | ERR_USAGE,
"file `%s' is both input and output file",
inname);
}
if (*errname) {
error_file = fopen(errname, "w");