diff options
Diffstat (limited to 'archival/dpkg.c')
-rw-r--r-- | archival/dpkg.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/archival/dpkg.c b/archival/dpkg.c index f41363d0f..6dee43f50 100644 --- a/archival/dpkg.c +++ b/archival/dpkg.c | |||
@@ -1034,7 +1034,6 @@ char **create_list(const char *filename) | |||
1034 | FILE *list_stream; | 1034 | FILE *list_stream; |
1035 | char **file_list = xmalloc(sizeof(char *)); | 1035 | char **file_list = xmalloc(sizeof(char *)); |
1036 | char *line = NULL; | 1036 | char *line = NULL; |
1037 | char *last_char; | ||
1038 | int length = 0; | 1037 | int length = 0; |
1039 | int count = 0; | 1038 | int count = 0; |
1040 | 1039 | ||
@@ -1047,10 +1046,7 @@ char **create_list(const char *filename) | |||
1047 | while (getline(&line, &length, list_stream) != -1) { | 1046 | while (getline(&line, &length, list_stream) != -1) { |
1048 | /* +2 as we need to include space for the terminating NULL pointer */ | 1047 | /* +2 as we need to include space for the terminating NULL pointer */ |
1049 | file_list = xrealloc(file_list, sizeof(char *) * (length + 2)); | 1048 | file_list = xrealloc(file_list, sizeof(char *) * (length + 2)); |
1050 | last_char = last_char_is(line, '\n'); | 1049 | chomp(line); |
1051 | if (last_char) { | ||
1052 | *last_char = '\0'; | ||
1053 | } | ||
1054 | file_list[count] = xstrdup(line); | 1050 | file_list[count] = xstrdup(line); |
1055 | count++; | 1051 | count++; |
1056 | } | 1052 | } |