summaryrefslogtreecommitdiffstats
path: root/window.c
diff options
context:
space:
mode:
authornicm <nicm>2017-04-20 09:39:07 +0000
committernicm <nicm>2017-04-20 09:39:07 +0000
commit0f25ad3ca32d329500ac830f3c13e60ead4cb3db (patch)
tree344da6fae9cf32caf143ea4064a733e05d111614 /window.c
parent0b44ad99b51606a8cab662e04cf043a8c4a3ca92 (diff)
There is no real need for window_printable_flags to allocate, make it
return a buffer from the stack.
Diffstat (limited to 'window.c')
-rw-r--r--window.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/window.c b/window.c
index 0dea2b4a..b0be6220 100644
--- a/window.c
+++ b/window.c
@@ -710,11 +710,11 @@ window_destroy_panes(struct window *w)
}
/* Retuns the printable flags on a window, empty string if no flags set. */
-char *
+const char *
window_printable_flags(struct session *s, struct winlink *wl)
{
- char flags[32];
- int pos;
+ static char flags[32];
+ int pos;
pos = 0;
if (wl->flags & WINLINK_ACTIVITY)
@@ -732,7 +732,7 @@ window_printable_flags(struct session *s, struct winlink *wl)
if (wl->window->flags & WINDOW_ZOOMED)
flags[pos++] = 'Z';
flags[pos] = '\0';
- return (xstrdup(flags));
+ return (flags);
}
struct window_pane *