Changed line[strlen(line) - 1] = '\0'; to chomp(line);
authorMark Whitley <markw@lineo.com>
Tue, 17 Apr 2001 18:26:11 +0000 (18:26 -0000)
committerMark Whitley <markw@lineo.com>
Tue, 17 Apr 2001 18:26:11 +0000 (18:26 -0000)
coreutils/sort.c
sort.c

index b84453d3a4f17b19670490edb676cbc6b5ecbbb6..5ecca8b8f841157b1404a03767fbbbfe5412e930 100644 (file)
@@ -71,7 +71,7 @@ int sort_main(int argc, char **argv)
 
                while ((line = get_line_from_file(fp)) != NULL) {
                        lines = xrealloc(lines, sizeof(char *) * (nlines + 1));
-                       line[strlen(line) - 1] = '\0';
+                       chomp(line);
                        lines[nlines++] = line;
                }
        }
diff --git a/sort.c b/sort.c
index b84453d3a4f17b19670490edb676cbc6b5ecbbb6..5ecca8b8f841157b1404a03767fbbbfe5412e930 100644 (file)
--- a/sort.c
+++ b/sort.c
@@ -71,7 +71,7 @@ int sort_main(int argc, char **argv)
 
                while ((line = get_line_from_file(fp)) != NULL) {
                        lines = xrealloc(lines, sizeof(char *) * (nlines + 1));
-                       line[strlen(line) - 1] = '\0';
+                       chomp(line);
                        lines[nlines++] = line;
                }
        }