consistent error check

This commit is contained in:
Connor Lane Smith
2011-06-04 12:20:41 +01:00
parent de221bc6f5
commit d90ced2047
13 changed files with 22 additions and 22 deletions

2
sort.c
View File

@@ -44,7 +44,7 @@ main(int argc, char *argv[])
qsort(lines, nlines, sizeof *lines, (int (*)(const void *, const void *))linecmp);
for(i = 0; i < nlines; i++)
if(!uflag || i == 0 || strcmp(lines[i], lines[i-1]) != 0)
if(!uflag || i == 0 || strcmp(lines[i], lines[i-1]) == -1)
fputs(lines[i], stdout);
return EXIT_SUCCESS;
}