diff --git a/src/db.c b/src/db.c index f5ef88f..a2c552e 100644 --- a/src/db.c +++ b/src/db.c @@ -63,7 +63,7 @@ llist *write_csv_to_llist(const char *filename) { int count = 0; // task counter fgets(line, sizeof(line), file); // read and ignore file head - while (fgets(line, sizeof(line), file)); + while (fgets(line, sizeof(line), file)){ count++; // remove newline sign line[strcspn(line, "\n")] = '\0'; @@ -98,6 +98,7 @@ llist *write_csv_to_llist(const char *filename) { } } fclose(file); - return list; // null on error } + return list; // null on error +}