diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-12-26 20:56:55 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-12-26 20:56:55 +0000 |
commit | c03e8721128fa7803d40dd07084f7650e88c7355 (patch) | |
tree | c13760bac677e9d4220477c0ac29ed9c2a52c1a4 /modutils | |
parent | abee3d0e0dc7c7e4b733b0145c56bf8159a37a69 (diff) | |
download | busybox-w32-c03e8721128fa7803d40dd07084f7650e88c7355.tar.gz busybox-w32-c03e8721128fa7803d40dd07084f7650e88c7355.tar.bz2 busybox-w32-c03e8721128fa7803d40dd07084f7650e88c7355.zip |
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 'modutils')
-rw-r--r-- | modutils/modprobe.c | 5 |
1 files changed, 1 insertions, 4 deletions
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 | |||
242 | 242 | ||
243 | while (reads(fd, buffer, buflen)) { | 243 | while (reads(fd, buffer, buflen)) { |
244 | int l; | 244 | int l; |
245 | char *p; | ||
246 | 245 | ||
247 | p = strchr(buffer, '#'); | 246 | *strchrnul(buffer, '#') = '\0'; |
248 | if (p) | ||
249 | *p = '\0'; | ||
250 | 247 | ||
251 | l = strlen(buffer); | 248 | l = strlen(buffer); |
252 | 249 | ||