diff options
author | Glenn L McGrath <bug1@ihug.co.nz> | 2002-12-11 06:10:13 +0300 |
---|---|---|
committer | Glenn L McGrath <bug1@ihug.co.nz> | 2002-12-11 06:10:13 +0300 |
commit | b323162aab71137efd7137c7b38946687d360e4f (patch) | |
tree | a55912bc592770705623b73d639966616e540d61 /archival/dpkg.c | |
parent | 11adab05352d572adfc87e0f58201040658d7ca0 (diff) |
Use libbb/get_line_from_file instead of getline
Diffstat (limited to 'archival/dpkg.c')
-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) FILE *list_stream; char **file_list = NULL; char *line = NULL; - int length = 0; int count = 0; /* dont use [xw]fopen here, handle error ourself */ @@ -1066,14 +1065,13 @@ char **create_list(const char *filename) return(NULL); } - while (getline(&line, &length, list_stream) != -1) { + while ((line = get_line_from_file(list_stream)) != NULL) { file_list = xrealloc(file_list, sizeof(char *) * (count + 2)); chomp(line); - file_list[count] = xstrdup(line); + file_list[count] = line; count++; } fclose(list_stream); - free(line); if (count == 0) { return(NULL); |