diff options
author | Nicholas Marriott <nicm@openbsd.org> | 2010-01-27 20:26:42 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@openbsd.org> | 2010-01-27 20:26:42 +0000 |
commit | 05213e4c8cb083669382e0287481df994827352f (patch) | |
tree | e837f57ae47d2a56ba02597832c3ff4df06dea21 | |
parent | 3e2cc2d2c4c443cc99086927c83547d50cb07369 (diff) | |
download | rtmux-05213e4c8cb083669382e0287481df994827352f.tar.gz rtmux-05213e4c8cb083669382e0287481df994827352f.tar.bz2 rtmux-05213e4c8cb083669382e0287481df994827352f.zip |
Calculate offset correctly, fixes incorrect offset and prevents crash when
status-left is empty. From Micah Cowan.
-rw-r--r-- | status.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -302,18 +302,20 @@ draw: } /* Figure out the offset for the window list. */ - wloffset = 1; + if (llen != 0) + wloffset = llen + 1; + else + wloffset = 0; if (wlwidth < wlavailable) { switch (options_get_number(&s->options, "status-justify")) { case 1: /* centered */ - wloffset = 1 + (wlavailable - wlwidth) / 2; + wloffset += (wlavailable - wlwidth) / 2; break; case 2: /* right */ - wloffset = 1 + (wlavailable - wlwidth); + wloffset += (wlavailable - wlwidth); break; } } - wloffset += llen; if (larrow != 0) wloffset++; |