diff options
-rw-r--r-- | coreutils/sort.c | 2 | ||||
-rw-r--r-- | sort.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/coreutils/sort.c b/coreutils/sort.c index b84453d3a..5ecca8b8f 100644 --- a/coreutils/sort.c +++ b/coreutils/sort.c | |||
@@ -71,7 +71,7 @@ int sort_main(int argc, char **argv) | |||
71 | 71 | ||
72 | while ((line = get_line_from_file(fp)) != NULL) { | 72 | while ((line = get_line_from_file(fp)) != NULL) { |
73 | lines = xrealloc(lines, sizeof(char *) * (nlines + 1)); | 73 | lines = xrealloc(lines, sizeof(char *) * (nlines + 1)); |
74 | line[strlen(line) - 1] = '\0'; | 74 | chomp(line); |
75 | lines[nlines++] = line; | 75 | lines[nlines++] = line; |
76 | } | 76 | } |
77 | } | 77 | } |
@@ -71,7 +71,7 @@ int sort_main(int argc, char **argv) | |||
71 | 71 | ||
72 | while ((line = get_line_from_file(fp)) != NULL) { | 72 | while ((line = get_line_from_file(fp)) != NULL) { |
73 | lines = xrealloc(lines, sizeof(char *) * (nlines + 1)); | 73 | lines = xrealloc(lines, sizeof(char *) * (nlines + 1)); |
74 | line[strlen(line) - 1] = '\0'; | 74 | chomp(line); |
75 | lines[nlines++] = line; | 75 | lines[nlines++] = line; |
76 | } | 76 | } |
77 | } | 77 | } |