Merge branch 'maint'

Conflicts:
	src/day.c
	src/recur.c
This commit is contained in:
Lukas Fleischer
2012-11-23 18:46:38 +01:00
12 changed files with 244 additions and 160 deletions

View File

@@ -107,13 +107,13 @@ unsigned event_inday(struct event *i, long *start)
/* Write to file the event in user-friendly format */
void event_write(struct event *o, FILE * f)
{
struct tm *lt;
struct tm lt;
time_t t;
t = o->day;
lt = localtime(&t);
fprintf(f, "%02u/%02u/%04u [%d] ", lt->tm_mon + 1, lt->tm_mday,
1900 + lt->tm_year, o->id);
localtime_r(&t, &lt);
fprintf(f, "%02u/%02u/%04u [%d] ", lt.tm_mon + 1, lt.tm_mday,
1900 + lt.tm_year, o->id);
if (o->note != NULL)
fprintf(f, ">%s ", o->note);
fprintf(f, "%s\n", o->mesg);
@@ -123,10 +123,7 @@ void event_write(struct event *o, FILE * f)
struct event *event_scan(FILE * f, struct tm start, int id, char *note)
{
char buf[BUFSIZ], *nl;
time_t tstart, t;
t = time(NULL);
localtime(&t);
time_t tstart;
/* Read the event description */
if (!fgets(buf, sizeof buf, f))