diff options
author | John Kohl <jtkohl@mit.edu> | 1990-01-18 04:18:39 +0000 |
---|---|---|
committer | John Kohl <jtkohl@mit.edu> | 1990-01-18 04:18:39 +0000 |
commit | 3228d19b87d63aadd37bbe46547108032ad15b3c (patch) | |
tree | bea70a67337a917acaf6f815decbb934d3fff80f /zwgc/xshow.c | |
parent | 050b5385da7a3b55104e5f9b5e01c78e422269a6 (diff) |
fix array index bug when using @center(), @left(), @right()
Diffstat (limited to 'zwgc/xshow.c')
-rw-r--r-- | zwgc/xshow.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/zwgc/xshow.c b/zwgc/xshow.c index 8969941..4415f55 100644 --- a/zwgc/xshow.c +++ b/zwgc/xshow.c @@ -243,7 +243,12 @@ void fixup_and_draw(dpy, style, auxblocks, blocks, num, lines, numlines, break; case 3: - width = lsize*2+csize+XTextWidth(auxblocks[i].font," ",1); + /* in all these cases, we just want to add the width of *any* + space, so the first font will do just fine. */ + /* XXX implicit assumption that a line must have at least one + block, so that there is indeed a reasonable font in + auxblocks[0].font */ + width = lsize*2+csize+XTextWidth(auxblocks[0].font," ",1); break; case 4: @@ -251,16 +256,16 @@ void fixup_and_draw(dpy, style, auxblocks, blocks, num, lines, numlines, break; case 5: - width = lsize+rsize+XTextWidth(auxblocks[i].font, " ", 1); + width = lsize+rsize+XTextWidth(auxblocks[0].font, " ", 1); break; case 6: - width = csize+rsize*2+XTextWidth(auxblocks[i].font, " ", 1); + width = csize+rsize*2+XTextWidth(auxblocks[0].font, " ", 1); break; case 7: width = max(lsize,rsize)*2+csize+ - XTextWidth(auxblocks[i].font," ",1)*2; + XTextWidth(auxblocks[0].font," ",1)*2; break; } if (width>maxwidth) |