diff options
-rw-r--r-- | archival/dpkg.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/archival/dpkg.c b/archival/dpkg.c index d3e652bc8..692592268 100644 --- a/archival/dpkg.c +++ b/archival/dpkg.c | |||
@@ -1057,7 +1057,6 @@ char **create_list(const char *filename) | |||
1057 | FILE *list_stream; | 1057 | FILE *list_stream; |
1058 | char **file_list = NULL; | 1058 | char **file_list = NULL; |
1059 | char *line = NULL; | 1059 | char *line = NULL; |
1060 | int length = 0; | ||
1061 | int count = 0; | 1060 | int count = 0; |
1062 | 1061 | ||
1063 | /* dont use [xw]fopen here, handle error ourself */ | 1062 | /* dont use [xw]fopen here, handle error ourself */ |
@@ -1066,14 +1065,13 @@ char **create_list(const char *filename) | |||
1066 | return(NULL); | 1065 | return(NULL); |
1067 | } | 1066 | } |
1068 | 1067 | ||
1069 | while (getline(&line, &length, list_stream) != -1) { | 1068 | while ((line = get_line_from_file(list_stream)) != NULL) { |
1070 | file_list = xrealloc(file_list, sizeof(char *) * (count + 2)); | 1069 | file_list = xrealloc(file_list, sizeof(char *) * (count + 2)); |
1071 | chomp(line); | 1070 | chomp(line); |
1072 | file_list[count] = xstrdup(line); | 1071 | file_list[count] = line; |
1073 | count++; | 1072 | count++; |
1074 | } | 1073 | } |
1075 | fclose(list_stream); | 1074 | fclose(list_stream); |
1076 | free(line); | ||
1077 | 1075 | ||
1078 | if (count == 0) { | 1076 | if (count == 0) { |
1079 | return(NULL); | 1077 | return(NULL); |