Return empty string if format is empty rather than attempting to

allocate zero bytes.
pull/1/head
nicm 2015-05-20 06:39:02 +00:00
parent 2c53b23d59
commit 7140cce7f3
1 changed files with 1 additions and 1 deletions

View File

@ -335,7 +335,7 @@ format_expand_time(struct format_tree *ft, const char *fmt, time_t t)
size_t tmplen;
struct tm *tm;
if (fmt == NULL)
if (fmt == NULL || *fmt == '\0')
return (xstrdup(""));
tm = localtime(&t);