It is odd that pointer to 'char' type is compared with the '\0' value.

Correct compare with *eqword follows in a correct error message.
This commit is contained in:
dwarning 2018-10-29 17:00:13 +01:00 committed by Holger Vogt
parent d504991177
commit a2c5cb4301
1 changed files with 2 additions and 2 deletions

View File

@ -1385,7 +1385,7 @@ com_alter_mod(wordlist *wl)
eqword++; eqword++;
while (*eqword == ' ') while (*eqword == ' ')
eqword++; eqword++;
if (eqword == '\0') { if (*eqword == '\0') {
fprintf(cp_err, "Error: no filename given\n"); fprintf(cp_err, "Error: no filename given\n");
controlled_exit(1); controlled_exit(1);
} }
@ -1395,7 +1395,7 @@ com_alter_mod(wordlist *wl)
eqword += 4; eqword += 4;
while (*eqword == ' ') while (*eqword == ' ')
eqword++; eqword++;
if (eqword == '\0') { if (*eqword == '\0') {
fprintf(cp_err, "Error: no filename given\n"); fprintf(cp_err, "Error: no filename given\n");
controlled_exit(1); controlled_exit(1);
} }