Buffer reset gelöscht

bugfix
Jan Wild 2024-12-16 10:45:45 +01:00
parent 5f65a91ffb
commit 8d6d6b2870
No known key found for this signature in database
GPG Key ID: 0BCB2E053F2192BB
1 changed files with 3 additions and 2 deletions

View File

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