Good catch. status_replace1 is only called from status_replace so I
think its better to fix it there:
Index: status.c
===================================================================
RCS file: /cvs/src/usr.bin/tmux/status.c,v
retrieving revision 1.69
diff -u -p -r1.69 status.c
--- status.c 1 Jan 2011 16:51:21 -0000 1.69
+++ status.c 3 Jan 2011 21:08:29 -0000
@@ -456,7 +456,7 @@ status_replace(struct client *c,
break;
ch = *iptr++;
- if (ch != '#') {
+ if (ch != '#' || *iptr == '\0') {
*optr++ = ch;
continue;
}
On Mon, Jan 03, 2011 at 01:40:07PM +0000, Thomas Adam wrote:
> Hi,
>
> Currently, if I have this:
>
> setw -g window-status-current-format '#T:#'
>
> Or any other setting which gets run through status_replace1(), because
> there's nothing after the end '#' in the string, we blindly return first of
> all without NUL-terminating the output string. This results in garbage
> printed to the status line.
>
> See patch attached for fix.
>
> -- Thomas Adam
>
> --
> "It was the cruelest game I've ever played and it's played inside my head."
> -- "Hush The Warmth", Gorky's Zygotic Mynci.
> ------------------------------------------------------------------------------
> Learn how Oracle Real Application Clusters (RAC) One Node allows customers
> to consolidate database storage, standardize their database environment, and,
> should the need arise, upgrade to a full multi-node Oracle RAC database
> without downtime or disruption
> http://p.sf.net/sfu/oracle-sfdevnl
> _______________________________________________
> tmux-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/tmux-users
------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and,
should the need arise, upgrade to a full multi-node Oracle RAC database
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
tmux-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tmux-users