Compare commits
No commits in common. "6816c4eacff90de2089e4ed7927033741088c024" and "1f54110aa5c350b87a251347a9a3e446b3e13f74" have entirely different histories.
6816c4eacf
...
1f54110aa5
|
@ -1,7 +0,0 @@
|
||||||
<component name="ProjectRunConfigurationManager">
|
|
||||||
<configuration default="false" name="StudyPlanner" type="CMakeRunConfiguration" factoryName="Application" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" RUN_PATH="$PROJECT_DIR$/Makefile" EXPLICIT_BUILD_TARGET_NAME="all">
|
|
||||||
<method v="2">
|
|
||||||
<option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
|
|
||||||
</method>
|
|
||||||
</configuration>
|
|
||||||
</component>
|
|
13
src/db.c
13
src/db.c
|
@ -59,14 +59,11 @@ llist *write_csv_to_llist(const char *filename) {
|
||||||
fprintf(stderr, "Could not open file %s\n", filename);
|
fprintf(stderr, "Could not open file %s\n", filename);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
char *line = NULL; // Line Buffer
|
char line[1024]; // Line Buffer
|
||||||
size_t nnread, len;
|
|
||||||
int count = 0; // task counter
|
int count = 0; // task counter
|
||||||
getline(&line, &len, file);
|
fgets(line, sizeof(line), file); // read and ignore file head
|
||||||
free(line);
|
|
||||||
line = NULL;
|
|
||||||
|
|
||||||
while ((nnread = getline(&line, &len, file)) != -1) {
|
while (fgets(line, sizeof(line), file)){
|
||||||
count++;
|
count++;
|
||||||
// remove newline sign
|
// remove newline sign
|
||||||
line[strcspn(line, "\n")] = '\0';
|
line[strcspn(line, "\n")] = '\0';
|
||||||
|
@ -77,7 +74,7 @@ llist *write_csv_to_llist(const char *filename) {
|
||||||
char *taskdeadline_dateSTR = strtok(NULL, ",");
|
char *taskdeadline_dateSTR = strtok(NULL, ",");
|
||||||
char *taskprioritySTR = strtok(NULL, ",");
|
char *taskprioritySTR = strtok(NULL, ",");
|
||||||
char *taskspareSTR = strtok(NULL, ",");
|
char *taskspareSTR = strtok(NULL, ",");
|
||||||
printf(" Der Name des Task ist %s\n", taskname);
|
printf(" Der Name des Task ist %s\n",taskname);
|
||||||
|
|
||||||
// convert char in integer and date
|
// convert char in integer and date
|
||||||
unsigned long int taskcreation_date =
|
unsigned long int taskcreation_date =
|
||||||
|
@ -99,9 +96,9 @@ llist *write_csv_to_llist(const char *filename) {
|
||||||
// Append the task to the linked list
|
// Append the task to the linked list
|
||||||
llistAppend(list, task);
|
llistAppend(list, task);
|
||||||
}
|
}
|
||||||
line = NULL;
|
|
||||||
}
|
}
|
||||||
fclose(file);
|
fclose(file);
|
||||||
}
|
}
|
||||||
return list; // null on error
|
return list; // null on error
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
1
src/ui.c
1
src/ui.c
|
@ -99,7 +99,6 @@ int main(void) {
|
||||||
// if list exists use it to generate plan
|
// if list exists use it to generate plan
|
||||||
if (listT != NULL) {
|
if (listT != NULL) {
|
||||||
struct tm lc;
|
struct tm lc;
|
||||||
now = time(NULL);
|
|
||||||
localtime_r(&now, &lc);
|
localtime_r(&now, &lc);
|
||||||
lc.tm_hour += taskspare;
|
lc.tm_hour += taskspare;
|
||||||
time_t avail = mktime(&lc);
|
time_t avail = mktime(&lc);
|
||||||
|
|
Loading…
Reference in New Issue