diff options
author | Tiago Cunha <tcunha@gmx.com> | 2012-07-11 19:30:01 +0000 |
---|---|---|
committer | Tiago Cunha <tcunha@gmx.com> | 2012-07-11 19:30:01 +0000 |
commit | 06d27e94b25a49f7a9824e8bfdf6fb04f6baf46e (patch) | |
tree | ec4c02b2895a266a65bc569a794c559c12e416b5 | |
parent | 188be9718e1f55861bfb9d366b31e096a704d90e (diff) | |
download | rtmux-06d27e94b25a49f7a9824e8bfdf6fb04f6baf46e.tar.gz rtmux-06d27e94b25a49f7a9824e8bfdf6fb04f6baf46e.tar.bz2 rtmux-06d27e94b25a49f7a9824e8bfdf6fb04f6baf46e.zip |
Sync OpenBSD patchset 1149:
Move a NULL check inside a function, from Tiago Cunha.
-rw-r--r-- | status.c | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -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); |