summaryrefslogtreecommitdiff
path: root/src/core/wee-config.c
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2017-09-22 21:50:01 +0200
committerSébastien Helleu <flashcode@flashtux.org>2017-09-23 15:06:28 +0200
commit5aab494dd63e6cbbbb54fa0e362ae64e85dcadb3 (patch)
treee459fec713103315d7ae30aabd2269252ec77ab0 /src/core/wee-config.c
parentae66a4d8a586555104dfe633a97fa4a2f17db531 (diff)
downloadweechat-5aab494dd63e6cbbbb54fa0e362ae64e85dcadb3.zip
core, plugins: check return code of strftime function
Diffstat (limited to 'src/core/wee-config.c')
-rw-r--r--src/core/wee-config.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/core/wee-config.c b/src/core/wee-config.c
index 8ba515161..ff3497e17 100644
--- a/src/core/wee-config.c
+++ b/src/core/wee-config.c
@@ -994,9 +994,10 @@ config_get_item_time (char *text_time, int max_length)
date = time (NULL);
local_time = localtime (&date);
- strftime (text_time, max_length,
- config_item_time_evaluated,
- local_time);
+ if (strftime (text_time, max_length,
+ config_item_time_evaluated,
+ local_time) == 0)
+ text_time[0] = '\0';
}
/*
@@ -1281,7 +1282,8 @@ config_day_change_timer_cb (const void *pointer, void *data,
}
/* send signal "day_changed" */
- strftime (str_time, sizeof (str_time), "%Y-%m-%d", local_time);
+ if (strftime (str_time, sizeof (str_time), "%Y-%m-%d", local_time) == 0)
+ str_time[0] = '\0';
(void) hook_signal_send ("day_changed",
WEECHAT_HOOK_SIGNAL_STRING, str_time);
}