commit 65ad93dffac988b25debbe4c960b5785b3880caf
parent 117231130b05fc1bb785c826b5482fef264e4a10
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Mon, 13 Jul 2020 18:12:01 +0200
updatesidebar: small code-style tweak
Diffstat:
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/sfeed_curses.c b/sfeed_curses.c
@@ -1177,7 +1177,7 @@ updatesidebar(int onlynew)
struct pane *p;
struct row *row;
struct feed *feed;
- size_t i;
+ size_t i, nrows;
int len, width;
p = &panes[PaneFeeds];
@@ -1185,13 +1185,12 @@ updatesidebar(int onlynew)
if (!p->rows)
p->rows = ecalloc(sizeof(p->rows[0]), nfeeds + 1);
- p->nrows = 0;
- p->width = 0;
+ nrows = 0;
width = 0;
for (i = 0; i < nfeeds; i++) {
feed = &feeds[i];
- row = &(p->rows[p->nrows]);
+ row = &(p->rows[nrows]);
row->text = ""; /* custom formatter is used */
row->bold = (feed->totalnew > 0);
row->data = feed;
@@ -1203,8 +1202,9 @@ updatesidebar(int onlynew)
if (onlynew && feed->totalnew == 0)
continue;
- p->nrows++;
+ nrows++;
}
+ p->nrows = nrows;
p->width = width;
p->dirty = 1;
}