summaryrefslogtreecommitdiff
path: root/archival/dpkg.c
diff options
context:
space:
mode:
authorMatt Kraai2002-01-02 19:01:41 +0000
committerMatt Kraai2002-01-02 19:01:41 +0000
commit39fcb5a7502ffb35a90b9539478c5b0d314c3b8e (patch)
tree0338510114df960f2fa2f63a33cba5050c97d3b6 /archival/dpkg.c
parent0733e840bd1f94eee6a07f2a1986e29c9ddfe20c (diff)
downloadbusybox-39fcb5a7502ffb35a90b9539478c5b0d314c3b8e.zip
busybox-39fcb5a7502ffb35a90b9539478c5b0d314c3b8e.tar.gz
* archival/dpkg.c (create_list): Use chomp.
* archival/tar.c (append_file_list_to_list): Likewise.
Diffstat (limited to 'archival/dpkg.c')
-rw-r--r--archival/dpkg.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/archival/dpkg.c b/archival/dpkg.c
index f41363d..6dee43f 100644
--- a/archival/dpkg.c
+++ b/archival/dpkg.c
@@ -1034,7 +1034,6 @@ char **create_list(const char *filename)
FILE *list_stream;
char **file_list = xmalloc(sizeof(char *));
char *line = NULL;
- char *last_char;
int length = 0;
int count = 0;
@@ -1047,10 +1046,7 @@ char **create_list(const char *filename)
while (getline(&line, &length, list_stream) != -1) {
/* +2 as we need to include space for the terminating NULL pointer */
file_list = xrealloc(file_list, sizeof(char *) * (length + 2));
- last_char = last_char_is(line, '\n');
- if (last_char) {
- *last_char = '\0';
- }
+ chomp(line);
file_list[count] = xstrdup(line);
count++;
}