Re: PATCH: Correctly NUL-terminate status_replace1() **optr

2011-01-03 Thread Nicholas Marriott
Yep. I thought of having status_replace1 do the check but this is better. On Mon, Jan 03, 2011 at 09:14:06PM +, Thomas Adam wrote: > On Mon, Jan 03, 2011 at 09:09:11PM +, Nicholas Marriott wrote: > > Good catch. status_replace1 is only called from status_replace so I > > think its better

Re: PATCH: Correctly NUL-terminate status_replace1() **optr

2011-01-03 Thread Thomas Adam
On Mon, Jan 03, 2011 at 09:09:11PM +, Nicholas Marriott wrote: > Good catch. status_replace1 is only called from status_replace so I > think its better to fix it there: If you can guarantee it will always be that way round (and that nothing in the future won't ever likely call status_replace1(

Re: PATCH: Correctly NUL-terminate status_replace1() **optr

2011-01-03 Thread Nicholas Marriott
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.c1

PATCH: Correctly NUL-terminate status_replace1() **optr

2011-01-03 Thread Thomas Adam
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 pr