save a bit of code with *strchrnul = '\0' trick
function old new delta nextline 59 55 -4 include_conf 902 898 -4 read_config 414 406 -8 fsck_main 1880 1869 -11
This commit is contained in:
@ -554,13 +554,9 @@ static void setup(servtab_t *sep)
|
||||
|
||||
static char *nextline(void)
|
||||
{
|
||||
char *cp;
|
||||
|
||||
if (fgets(line, LINE_SIZE, fconfig) == NULL)
|
||||
return NULL;
|
||||
cp = strchr(line, '\n');
|
||||
if (cp)
|
||||
*cp = '\0';
|
||||
*strchrnul(line, '\n') = '\0';
|
||||
return line;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user