diff options
author | marcinzelent <marcin@zelent.net> | 2017-06-20 17:22:33 +0200 |
---|---|---|
committer | marcinzelent <marcin@zelent.net> | 2017-06-20 17:22:33 +0200 |
commit | c1b00b215ae91638de367bf43cab9aaeac0f4e04 (patch) | |
tree | 26944b2bac8361731e0909586c76dfd1e339d417 | |
parent | 8538498d32b83b7517302141030936a673842a66 (diff) |
Fixed formatting.
-rw-r--r-- | timetracker.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/timetracker.c b/timetracker.c index 5c805db..3aaa40f 100644 --- a/timetracker.c +++ b/timetracker.c @@ -151,14 +151,13 @@ void save_to_file() fprintf(fp, "%ld;%ld;%s\n", activities_list[i].start_time, activities_list[i].end_time, activities_list[i].description); } - fclose(fp); } void load_file() { - FILE *fp; - time_t rawtime; + FILE *fp; + time_t rawtime; struct tm *info; char buffer[80]; @@ -166,12 +165,12 @@ void load_file() strftime(buffer, 80, "%Y-%m-%d", localtime(&rawtime)); - char filename[80]; - snprintf(filename, sizeof(filename), "%s/Timesheets/timesheet-%s.txt", getenv("HOME"), buffer); - fp = fopen(filename, "r"); + char filename[80]; + snprintf(filename, sizeof(filename), "%s/Timesheets/timesheet-%s.txt", getenv("HOME"), buffer); + fp = fopen(filename, "r"); int i = 0; - + while (EOF != fscanf(fp, "%ld;%ld;%s", &activities_list[i].start_time, &activities_list[i].end_time, activities_list[i].description)) i++; } |