diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2015-05-20 06:39:03 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2015-05-20 06:39:03 +0000 |
commit | 516de892a39145eb8b22bca142cf89b724b9505d (patch) | |
tree | 6ba924eb64f54aa7df1e7e8225101c967b8edcc6 /usr.bin/tmux/format.c | |
parent | 8b432411a48383fea7d4e20e32020a62feba701c (diff) |
Return empty string if format is empty rather than attempting to
allocate zero bytes.
Diffstat (limited to 'usr.bin/tmux/format.c')
-rw-r--r-- | usr.bin/tmux/format.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/tmux/format.c b/usr.bin/tmux/format.c index 8b47b361f92..9bf9a1cd927 100644 --- a/usr.bin/tmux/format.c +++ b/usr.bin/tmux/format.c @@ -1,4 +1,4 @@ -/* $OpenBSD: format.c,v 1.66 2015/05/12 15:29:29 nicm Exp $ */ +/* $OpenBSD: format.c,v 1.67 2015/05/20 06:39:02 nicm Exp $ */ /* * Copyright (c) 2011 Nicholas Marriott <nicm@users.sourceforge.net> @@ -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); |