{
double latency = -1.0;
size_t buffer_len = sizeof (latency);
+ int maxx;
+ getmaxyx(ctx->window, maxx, maxx);
+
ping_iterator_get_info (iter, PING_INFO_LATENCY,
&latency, &buffer_len);
}
wattron (ctx->window, COLOR_PAIR(color));
mvwprintw (ctx->window,
- /* y = */ 3, /* x = */ 1 + sequence,
+ /* y = */ 3,
+ /* x = */ (1 + sequence) % maxx,
bars[index]);
wattroff (ctx->window, COLOR_PAIR(color));
}
else {
wattron (ctx->window, COLOR_PAIR(OPING_RED) | A_BOLD);
mvwprintw (ctx->window,
- /* y = */ 3, /* x = */ 1 + sequence,
+ /* y = */ 3,
+ /* x = */ (1 + sequence) % maxx,
"!");
wattroff (ctx->window, COLOR_PAIR(OPING_RED) | A_BOLD);
}