diff options
author | Denis Vlasenko | 2007-12-26 20:56:55 +0000 |
---|---|---|
committer | Denis Vlasenko | 2007-12-26 20:56:55 +0000 |
commit | c03e8721128fa7803d40dd07084f7650e88c7355 (patch) | |
tree | c13760bac677e9d4220477c0ac29ed9c2a52c1a4 /networking/inetd.c | |
parent | abee3d0e0dc7c7e4b733b0145c56bf8159a37a69 (diff) | |
download | busybox-c03e8721128fa7803d40dd07084f7650e88c7355.zip busybox-c03e8721128fa7803d40dd07084f7650e88c7355.tar.gz |
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
Diffstat (limited to 'networking/inetd.c')
-rw-r--r-- | networking/inetd.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/networking/inetd.c b/networking/inetd.c index 5d37746..a9c9397 100644 --- a/networking/inetd.c +++ b/networking/inetd.c @@ -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; } |