diff options
author | Nicholas Marriott <nicm@openbsd.org> | 2012-01-26 09:05:54 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@openbsd.org> | 2012-01-26 09:05:54 +0000 |
commit | a7a44bfcd9f1eeec2b82b6490b35893dcb7c053f (patch) | |
tree | 011bb201f08ea18df84848ed31f958e65afe4b1e /status.c | |
parent | d2d2df136502f95da8fa749f10a1e534fca7cde2 (diff) | |
download | rtmux-a7a44bfcd9f1eeec2b82b6490b35893dcb7c053f.tar.gz rtmux-a7a44bfcd9f1eeec2b82b6490b35893dcb7c053f.tar.bz2 rtmux-a7a44bfcd9f1eeec2b82b6490b35893dcb7c053f.zip |
Terminate strftime buffer properly even if a really long format string
is given, from Tiago Cunha.
Diffstat (limited to 'status.c')
-rw-r--r-- | status.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -491,9 +491,10 @@ status_replace(struct client *c, struct session *s, struct winlink *wl, { static char out[BUFSIZ]; char in[BUFSIZ], ch, *iptr, *optr; + size_t len; - strftime(in, sizeof in, fmt, localtime(&t)); - in[(sizeof in) - 1] = '\0'; + len = strftime(in, sizeof in, fmt, localtime(&t)); + in[len] = '\0'; iptr = in; optr = out; |