Compare commits

..

2 Commits

Author SHA1 Message Date
ketrptr 1f54110aa5 Merge branch 'bugfix' of https://gitea.fhgr.ch/schurtisimon/StudyPlanner into bugfix 2024-12-16 10:50:39 +01:00
ketrptr 60cfa51406 modified: src/ui.c 2024-12-16 10:50:02 +01:00
1 changed files with 8 additions and 2 deletions

View File

@ -11,6 +11,7 @@
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#ifdef _WIN32
@ -24,6 +25,7 @@ int main(void) {
int taskdeadline_date = 0;
int taskpriority = 0;
int taskspare = 0;
char *taskname = NULL; // taskName Buffer
llist *listT = NULL;
llist *listE = NULL;
@ -44,7 +46,7 @@ int main(void) {
continue;
};
char *taskname = NULL; // taskName Buffer
taskname = NULL;
size_t nameLen;
size_t nnread;
switch (choice) {
@ -96,7 +98,11 @@ int main(void) {
scanf("%d", &taskspare);
// if list exists use it to generate plan
if (listT != NULL) {
listE = genPlan(listT, taskspare);
struct tm lc;
localtime_r(&now, &lc);
lc.tm_hour += taskspare;
time_t avail = mktime(&lc);
listE = genPlan(listT, avail);
write_linkedlist_to_csv(listT, dbName);
} else {
printf("list is empty!");