diff options
author | nicm <nicm> | 2015-05-20 06:39:02 +0000 |
---|---|---|
committer | nicm <nicm> | 2015-05-20 06:39:02 +0000 |
commit | 7140cce7f31eb2135491fdc62645b4753d941520 (patch) | |
tree | 68c9a2ee58755010709e50df70906f70e27e99ca /format.c | |
parent | 2c53b23d5968da2e796ead6ed9f8ff3c33b8bbfb (diff) |
Return empty string if format is empty rather than attempting to
allocate zero bytes.
Diffstat (limited to 'format.c')
-rw-r--r-- | format.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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); |