From 7140cce7f31eb2135491fdc62645b4753d941520 Mon Sep 17 00:00:00 2001 From: nicm Date: Wed, 20 May 2015 06:39:02 +0000 Subject: [PATCH] Return empty string if format is empty rather than attempting to allocate zero bytes. --- format.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/format.c b/format.c index db6f9231..eff1668d 100644 --- a/format.c +++ b/format.c @@ -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);