svn commit: trunk/busybox/modutils

aldot at busybox.net aldot at busybox.net
Mon May 26 13:30:42 UTC 2008


Author: aldot
Date: 2008-05-26 06:30:41 -0700 (Mon, 26 May 2008)
New Revision: 22081

Log:
- remove some bloat -28b: now approx. 501b


Modified:
   trunk/busybox/modutils/depmod.c


Changeset:
Modified: trunk/busybox/modutils/depmod.c
===================================================================
--- trunk/busybox/modutils/depmod.c	2008-05-26 12:19:35 UTC (rev 22080)
+++ trunk/busybox/modutils/depmod.c	2008-05-26 13:30:41 UTC (rev 22081)
@@ -21,7 +21,7 @@
 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 @@
 	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 @@
 	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 @@
 		}
 	} while (*++argv);
 
-	if (ENABLE_FEATURE_CLEAN_UP)
+	if (ENABLE_FEATURE_CLEAN_UP) {
 		fclose(filedes);
+		llist_free(G.lst, free);
+	}
 	return retval;
 }




More information about the busybox-cvs mailing list