diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2011-11-27 11:48:35 +0100 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2011-11-27 11:48:35 +0100 |
commit | 41b5ef1e4cc6a28bd7274a016d83c95a93656248 (patch) | |
tree | a3df43ccbe1498745e84c6ccdc4f8db20e153f02 /src/plugins/relay/relay-buffer.c | |
parent | 8ba8e625800462b060bc9e0cfc73dd05059c1f59 (diff) | |
download | weechat-41b5ef1e4cc6a28bd7274a016d83c95a93656248.zip |
core: check pointer returned by function localtime
Diffstat (limited to 'src/plugins/relay/relay-buffer.c')
-rw-r--r-- | src/plugins/relay/relay-buffer.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/plugins/relay/relay-buffer.c b/src/plugins/relay/relay-buffer.c index f491be24b..5501f6cfd 100644 --- a/src/plugins/relay/relay-buffer.c +++ b/src/plugins/relay/relay-buffer.c @@ -95,15 +95,22 @@ relay_buffer_refresh (const char *hotlist) } } + date_start[0] = '\0'; date_tmp = localtime (&(ptr_client->start_time)); - strftime (date_start, sizeof (date_start), - "%a, %d %b %Y %H:%M:%S", date_tmp); + if (date_tmp) + { + strftime (date_start, sizeof (date_start), + "%a, %d %b %Y %H:%M:%S", date_tmp); + } date_end[0] = '\0'; if (ptr_client->end_time > 0) { date_tmp = localtime (&(ptr_client->end_time)); - strftime (date_end, sizeof (date_end), - "%a, %d %b %Y %H:%M:%S", date_tmp); + if (date_tmp) + { + strftime (date_end, sizeof (date_end), + "%a, %d %b %Y %H:%M:%S", date_tmp); + } } /* first line with status and start time */ |