summaryrefslogtreecommitdiff
path: root/src/interaction.c
diff options
context:
space:
mode:
authorLukas Fleischer <calcurse@cryptocrack.de>2012-11-23 18:46:38 +0100
committerLukas Fleischer <calcurse@cryptocrack.de>2012-11-23 19:03:57 +0100
commit1f0f05ecc1aae138b700df9ff2200abf4fd110f2 (patch)
tree1430bfcd2f79c47b2329c40320e67ecf3fa783c2 /src/interaction.c
parent7733d52f3249fee2a1d875d6923b8d2506dea5e4 (diff)
parent0ea23c24bf06e153bb075804e195e1733fd67d3f (diff)
downloadcalcurse-1f0f05ecc1aae138b700df9ff2200abf4fd110f2.zip
Merge branch 'maint'
Conflicts: src/day.c src/recur.c
Diffstat (limited to 'src/interaction.c')
-rw-r--r--src/interaction.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/interaction.c b/src/interaction.c
index 2d6830e..635f78a 100644
--- a/src/interaction.c
+++ b/src/interaction.c
@@ -234,7 +234,7 @@ static void update_rept(struct rpt **rpt, const long start)
newuntil = 0;
date_entered = 1;
} else {
- struct tm *lt;
+ struct tm lt;
time_t t;
struct date new_date;
int newmonth, newday, newyear;
@@ -242,11 +242,11 @@ static void update_rept(struct rpt **rpt, const long start)
if (parse_date(timstr, conf.input_datefmt, &newyear, &newmonth,
&newday, calendar_get_slctd_day())) {
t = start;
- lt = localtime(&t);
+ localtime_r(&t, &lt);
new_date.dd = newday;
new_date.mm = newmonth;
new_date.yyyy = newyear;
- newuntil = date2sec(new_date, lt->tm_hour, lt->tm_min);
+ newuntil = date2sec(new_date, lt.tm_hour, lt.tm_min);
if (newuntil < start) {
status_mesg(msg_wrong_time, msg_enter);
wgetch(win[STA].p);
@@ -704,7 +704,7 @@ void interact_todo_pipe(void)
*/
void interact_day_item_repeat(void)
{
- struct tm *lt;
+ struct tm lt;
time_t t;
int date_entered = 0;
int year = 0, month = 0, day = 0;
@@ -789,11 +789,11 @@ void interact_day_item_repeat(void)
if (parse_date(user_input, conf.input_datefmt,
&year, &month, &day, calendar_get_slctd_day())) {
t = p->start;
- lt = localtime(&t);
+ localtime_r(&t, &lt);
until_date.dd = day;
until_date.mm = month;
until_date.yyyy = year;
- until = date2sec(until_date, lt->tm_hour, lt->tm_min);
+ until = date2sec(until_date, lt.tm_hour, lt.tm_min);
if (until < p->start) {
status_mesg(mesg_older, wrong_type_2);
wgetch(win[STA].p);