From d427f741432742e2aba05ac610421c7661ea4a30 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Sun, 14 Jan 2001 18:02:03 +0000 Subject: Check the return value of strftime() properly git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1113 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/fe-common/core/fe-windows.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/fe-common/core') diff --git a/src/fe-common/core/fe-windows.c b/src/fe-common/core/fe-windows.c index 5f2af823..fba29a51 100644 --- a/src/fe-common/core/fe-windows.c +++ b/src/fe-common/core/fe-windows.c @@ -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; -- cgit v1.2.3