From 7f6a2c865bc450aaa4b496eb729dba111df08855 Mon Sep 17 00:00:00 2001 From: wildjan Date: Sat, 14 Dec 2024 22:11:47 +0100 Subject: [PATCH] change lu zu llu --- src/db.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/db.c b/src/db.c index da2725a..d347376 100644 --- a/src/db.c +++ b/src/db.c @@ -36,7 +36,7 @@ void write_linkedlist_to_csv(llist *head, const char *filename) { while (current != NULL) { // Write the task data to the CSV file Task *task = (Task *) (current->data); - fprintf(file, "%s, %lu, %lu, %d, %lu\n", + fprintf(file, "%s, %llu, %llu, %d, %lu\n", task->name, task->created, task->deadline, @@ -79,10 +79,10 @@ llist *write_csv_to_llist(const char *filename) { // convert char in integer and date - unsigned long int task_creation_date = strtoul(task_creation_dateSTR,NULL, 10); - unsigned long int task_deadline_date = strtoul(task_deadline_dateSTR,NULL, 10); - unsigned long int task_spare = strtoul(task_spareSTR,NULL, 10); - int task_priority = (int) strtol(task_prioritySTR, NULL, 10); + unsigned long long int task_creation_date = (unsigned long long int)strtoul(task_creation_dateSTR, NULL, 10); + unsigned long long int task_deadline_date = (unsigned long long int)strtoul(task_deadline_dateSTR,NULL, 10); + unsigned long int task_spare = (unsigned long int)strtoul(task_spareSTR,NULL, 10); + int task_priority = (int)strtol(task_prioritySTR, NULL, 10); //create Task