aboutsummaryrefslogtreecommitdiff
path: root/sort.c
diff options
context:
space:
mode:
Diffstat (limited to 'sort.c')
-rw-r--r--sort.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sort.c b/sort.c
index a5c09b1..ee4949d 100644
--- a/sort.c
+++ b/sort.c
@@ -7,7 +7,7 @@ int main(void) {
lines = vec_init();
- while ((line = read_line(stdin)) != NULL) {
+ while ((line = read_line(stdin))) {
vec_add(lines, line);
}
free(line);
@@ -34,7 +34,7 @@ char *read_line(FILE* stream) {
buf = malloc(BUF_SIZE);
for (;;) {
- if (fgets(buf, BUF_SIZE, stream) == NULL) {
+ if (!fgets(buf, BUF_SIZE, stream)) {
free(buf);
free(line);
return NULL;