From bb8235cbe9e8876efd5df1148c4072ded5b4b38e 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. --- usr.bin/tmux/format.c | 4 ++-- 1 file 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 @@ -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); -- 2.20.1