modified: src/ui.c
parent
2b162f532f
commit
d7cf85b44f
6
src/ui.c
6
src/ui.c
|
@ -20,7 +20,6 @@
|
|||
const char *dbName = "db.csv";
|
||||
|
||||
int main(void) {
|
||||
char taskname[256]; // taskName Buffer
|
||||
int taskcreation_date = 0;
|
||||
int taskdeadline_date = 0;
|
||||
int taskpriority = 0;
|
||||
|
@ -45,13 +44,16 @@ int main(void) {
|
|||
continue;
|
||||
};
|
||||
|
||||
char *taskname = NULL; // taskName Buffer
|
||||
size_t nameLen;
|
||||
switch (choice) {
|
||||
case 1:
|
||||
printf(" Geben sie das gewünschte Fach ein: \n");
|
||||
fgetc(stdin);
|
||||
time_t now = time(NULL);
|
||||
struct tm lc;
|
||||
localtime_r(&now, &lc);
|
||||
if (fscanf(stdin, "%s", taskname) <= 0) {
|
||||
if (getline(&taskname, &nameLen, stdin) < 0) {
|
||||
printf("Ungültige Eingabe für den Namen.\n");
|
||||
return -1;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue