mirror of
https://github.com/irssi/irssi.git
synced 2026-08-10 20:33:46 +02:00
Check the return value of strftime() properly
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1113 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
aa447813d0
commit
d427f74143
2 changed files with 17 additions and 11 deletions
|
|
@ -421,13 +421,14 @@ static void sig_server_disconnected(SERVER_REC *server)
|
|||
static void sig_print_text(void)
|
||||
{
|
||||
GSList *tmp;
|
||||
char month[10];
|
||||
char month[100];
|
||||
time_t t;
|
||||
struct tm *tm;
|
||||
|
||||
t = time(NULL);
|
||||
tm = localtime(&t);
|
||||
strftime(month, sizeof(month)-1, "%b", tm);
|
||||
if (strftime(month, sizeof(month), "%b", tm) <= 0)
|
||||
month[0] = '\0';
|
||||
|
||||
if (tm->tm_hour != 0 || tm->tm_min != 0)
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue