aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2008-05-26 13:30:41 +0000
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2008-05-26 13:30:41 +0000
commitdc5d7fec350532d191ecfef49fa8b9b208b09f9f (patch)
treeeb7b9c048085331de5230b690b02e423175cd397
parent423465cd5e673ce3561d420e6655e34dfe2a4ebd (diff)
downloadbusybox-dc5d7fec350532d191ecfef49fa8b9b208b09f9f.tar.gz
- remove some bloat -28b: now approx. 501b
-rw-r--r--modutils/depmod.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/modutils/depmod.c b/modutils/depmod.c
index 903b073f8..489a0330e 100644
--- a/modutils/depmod.c
+++ b/modutils/depmod.c
@@ -21,7 +21,7 @@ struct globals {
static int fill_lst(const char *modulename, struct stat ATTRIBUTE_UNUSED *sb,
void ATTRIBUTE_UNUSED *data, int ATTRIBUTE_UNUSED depth)
{
- llist_add_to_end(&G.lst, strdup(modulename));
+ llist_add_to(&G.lst, strdup(modulename));
return TRUE;
}
@@ -35,7 +35,6 @@ static int fileAction(const char *fname, struct stat ATTRIBUTE_UNUSED *sb,
RESERVE_CONFIG_BUFFER(depends, 512);
RESERVE_CONFIG_BUFFER(buf1, 512);
- memset(buf1, 0, sizeof(buf1));
memset(depends, 0, sizeof(depends));
if (last_char_is(fname, 'o') == NULL) /* not a module */
@@ -55,7 +54,7 @@ static int fileAction(const char *fname, struct stat ATTRIBUTE_UNUSED *sb,
deps = depends;
while (*deps) {
llist_t * _lst = G.lst;
- ptr = memchr(deps, ',', strlen(deps));
+ ptr = strchr(deps, ',');
if (ptr != NULL)
*(char*)ptr = '\0';
/* remember the length of the current dependency plus eventual 0 byte */
@@ -105,7 +104,9 @@ int depmod_main(int ATTRIBUTE_UNUSED argc, char **argv)
}
} while (*++argv);
- if (ENABLE_FEATURE_CLEAN_UP)
+ if (ENABLE_FEATURE_CLEAN_UP) {
fclose(filedes);
+ llist_free(G.lst, free);
+ }
return retval;
}