From: Peter Korsgaard <[EMAIL PROTECTED]>

Saves a few bytes:

function                                             old     new   delta
create_list                                          124     103     -21
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-21)             Total: -21 bytes
---
 archival/dpkg.c |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/archival/dpkg.c b/archival/dpkg.c
index 1280ca0..5bc64d5 100644
--- a/archival/dpkg.c
+++ b/archival/dpkg.c
@@ -1164,15 +1164,11 @@ static char **create_list(const char *filename)
 
        while ((line = xmalloc_fgetline(list_stream)) != NULL) {
                file_list = xrealloc(file_list, sizeof(char *) * (count + 2));
-               file_list[count] = line;
-               count++;
+               file_list[count++] = line;
+               file_list[count] = NULL;
        }
        fclose(list_stream);
 
-       if (count == 0) {
-               return NULL;
-       }
-       file_list[count] = NULL;
        return file_list;
 }
 
-- 
1.5.5.1

_______________________________________________
busybox mailing list
[email protected]
http://busybox.net/cgi-bin/mailman/listinfo/busybox

Reply via email to