# HG changeset patch # User Richard Laager # Date 1139011361 0 # Node ID e42983a1038c2c73d281911f7b7bf8f761ac8116 # Parent c73c7dd0721f8932dbc2392fcc6bc08b4f29b7d5 [gaim-migrate @ 15477] Error handling for strftime. Yay for not having to do this for every use of strftime in Gaim... committer: Tailor Script diff -r c73c7dd0721f -r e42983a1038c src/util.c --- a/src/util.c Sat Feb 04 00:01:44 2006 +0000 +++ b/src/util.c Sat Feb 04 00:02:41 2006 +0000 @@ -490,7 +490,15 @@ static char buf[128]; char *utf8; - strftime(buf, sizeof(buf), format, tm); + /* A return value of 0 is either an error (in + * which case, the contents of the buffer are + * undefined) or the empty string (in which + * case, no harm is done here). */ + if (strftime(buf, sizeof(buf), format, tm) == 0) + { + buf = '\0'; + return buf; + } if ((utf8 = gaim_utf8_try_convert(buf))) {