From c03e8721128fa7803d40dd07084f7650e88c7355 Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Wed, 26 Dec 2007 20:56:55 +0000 Subject: 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 --- modutils/modprobe.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'modutils') diff --git a/modutils/modprobe.c b/modutils/modprobe.c index bc2dbd128..f6681a8d8 100644 --- a/modutils/modprobe.c +++ b/modutils/modprobe.c @@ -242,11 +242,8 @@ static void include_conf(struct dep_t **first, struct dep_t **current, char *buf while (reads(fd, buffer, buflen)) { int l; - char *p; - p = strchr(buffer, '#'); - if (p) - *p = '\0'; + *strchrnul(buffer, '#') = '\0'; l = strlen(buffer); -- cgit v1.2.3