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:
Timo Sirainen 2001-01-14 18:02:03 +00:00 committed by cras
commit d427f74143
2 changed files with 17 additions and 11 deletions

View file

@ -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;