pw-top: only check terminal size in non-batch mode

If ncurses is not initialized, then the global `LINES` variable stays 0.
This will cause problems because there is an unconditional `if (y > LINES)`
check when printing the driven nodes for a given driver node, resulting
in only the first one being printed.

Commit 71653e04d2 ("pw-top: add 'batch-mode' and iterations known from top")
that introduced batch mode missed this one condition, so fix that
by only checking the for terminal overflow in non-batch mode as
it is done a couple lines above.

Fixes #3899
This commit is contained in:
Barnabás Pőcze 2024-03-07 13:37:53 +01:00 committed by Wim Taymans
parent cf984fcd4c
commit c12e9a745d

View file

@ -577,7 +577,7 @@ static void do_refresh(struct data *d, bool force_refresh)
continue;
print_node(d, &n->info, f, y++);
if(y > LINES)
if(!d->batch_mode && y > LINES)
break;
}