Add braces to avoid ambiguity in a nested conditional (silences a gcc

warning).
This commit is contained in:
Sheldon Hearn 2000-04-26 10:38:19 +00:00
parent d08ae64b1d
commit 69f2cf17a3
1 changed files with 2 additions and 1 deletions

View File

@ -766,7 +766,7 @@ getloginname()
if (p < nbuf + (NBUFSIZ - 1))
*p++ = ch;
}
if (p > nbuf)
if (p > nbuf) {
if (nbuf[0] == '-')
(void)fprintf(stderr,
"login names may not start with '-'.\n");
@ -775,6 +775,7 @@ getloginname()
username = nbuf;
break;
}
}
}
}