mirror of
https://github.com/tmux/tmux.git
synced 2025-01-07 16:28:48 +00:00
Return empty string if format is empty rather than attempting to
allocate zero bytes.
This commit is contained in:
parent
2c53b23d59
commit
7140cce7f3
2
format.c
2
format.c
@ -335,7 +335,7 @@ format_expand_time(struct format_tree *ft, const char *fmt, time_t t)
|
|||||||
size_t tmplen;
|
size_t tmplen;
|
||||||
struct tm *tm;
|
struct tm *tm;
|
||||||
|
|
||||||
if (fmt == NULL)
|
if (fmt == NULL || *fmt == '\0')
|
||||||
return (xstrdup(""));
|
return (xstrdup(""));
|
||||||
|
|
||||||
tm = localtime(&t);
|
tm = localtime(&t);
|
||||||
|
Loading…
Reference in New Issue
Block a user