summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2012-07-09 09:55:57 +0000
committernicm <nicm@openbsd.org>2012-07-09 09:55:57 +0000
commit7f1a43da3403499b95e30f9e1287d241a6bbc94a (patch)
tree40ab34d974fb4e75d3a1e4e2f6da862ae7242739
parentAllow relayd to handle transactions > 2GB in size (diff)
downloadwireguard-openbsd-7f1a43da3403499b95e30f9e1287d241a6bbc94a.tar.xz
wireguard-openbsd-7f1a43da3403499b95e30f9e1287d241a6bbc94a.zip
Move a NULL check inside a function, from Tiago Cunha.
-rw-r--r--usr.bin/tmux/status.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/usr.bin/tmux/status.c b/usr.bin/tmux/status.c
index e11eb6848f5..a5df4e032f9 100644
--- a/usr.bin/tmux/status.c
+++ b/usr.bin/tmux/status.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: status.c,v 1.92 2012/04/29 07:33:41 nicm Exp $ */
+/* $OpenBSD: status.c,v 1.93 2012/07/09 09:55:57 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -515,6 +515,9 @@ status_replace(struct client *c, struct session *s, struct winlink *wl,
char in[BUFSIZ], ch, *iptr, *optr;
size_t len;
+ if (fmt == NULL)
+ return (xstrdup(""));
+
len = strftime(in, sizeof in, fmt, localtime(&t));
in[len] = '\0';
@@ -877,8 +880,6 @@ status_prompt_set(struct client *c, const char *msg, const char *input,
c->prompt_string = status_replace(c, NULL, NULL, NULL, msg,
time(NULL), 0);
- if (input == NULL)
- input = "";
c->prompt_buffer = status_replace(c, NULL, NULL, NULL, input,
time(NULL), 0);
c->prompt_index = strlen(c->prompt_buffer);
@@ -932,8 +933,6 @@ status_prompt_update(struct client *c, const char *msg, const char *input)
time(NULL), 0);
xfree(c->prompt_buffer);
- if (input == NULL)
- input = "";
c->prompt_buffer = status_replace(c, NULL, NULL, NULL, input,
time(NULL), 0);
c->prompt_index = strlen(c->prompt_buffer);