From: nicm Date: Wed, 20 May 2015 06:39:02 +0000 (+0000) Subject: Return empty string if format is empty rather than attempting to X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=bb8235cbe9e8876efd5df1148c4072ded5b4b38e;p=openbsd Return empty string if format is empty rather than attempting to allocate zero bytes. --- 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);