Signed-off-by: Vitezslav Samel <vitezslav(a)samel.cz>
---
src/hostmon.c | 19 ++++++-------------
src/itrafmon.c | 19 +++++--------------
src/serv.c | 17 +++++------------
3 files changed, 16 insertions(+), 39 deletions(-)
diff --git a/src/hostmon.c b/src/hostmon.c
index f780621..eb188d9 100644
--- a/src/hostmon.c
+++ b/src/hostmon.c
@@ -689,9 +689,6 @@ static void quicksort_lan_entries(struct ethtab *table, struct
ethtabent *low,
static void sort_hosttab(struct ethtab *list, unsigned int *idx, int command)
{
- struct ethtabent *ptemp1;
- int idxtmp;
-
if (!list->head)
return;
@@ -704,18 +701,13 @@ static void sort_hosttab(struct ethtab *list, unsigned int *idx, int
command)
quicksort_lan_entries(list, list->head, list->tail->prev_entry,
command);
- ptemp1 = list->firstvisible = list->head;
+ list->firstvisible = list->head;
*idx = 1;
- idxtmp = 0;
- tx_colorwin(list->tabwin);
- while ((ptemp1) && (idxtmp <= LINES - 4)) {
- printethent(list, ptemp1, *idx);
- idxtmp++;
- if (idxtmp <= LINES - 4)
- list->lastvisible = ptemp1;
- ptemp1 = ptemp1->next_entry;
+ struct ethtabent *ptmp = list->head;
+ while (ptmp && ((int)ptmp->index <= getmaxy(list->tabwin))) {
+ list->lastvisible = ptmp;
+ ptmp = ptmp->next_entry;
}
-
}
/*
@@ -903,6 +895,7 @@ void hostmon(time_t facilitytime, char *ifptr)
delwin(sortwin);
sort_hosttab(&table, &idx, ch);
keymode = 0;
+ refresh_hostmon_screen(&table, idx);
}
}
diff --git a/src/itrafmon.c b/src/itrafmon.c
index 390f93c..d6360a1 100644
--- a/src/itrafmon.c
+++ b/src/itrafmon.c
@@ -437,9 +437,6 @@ static void quicksort_tcp_entries(struct tcptable *table,
static void sortipents(struct tcptable *table, unsigned long *idx, int ch,
int logging, FILE *logfile)
{
- struct tcptableent *tcptmp1;
- unsigned int idxtmp;
-
if ((table->head == NULL)
|| (table->head->next_entry->next_entry == NULL))
return;
@@ -452,20 +449,14 @@ static void sortipents(struct tcptable *table, unsigned long *idx,
int ch,
quicksort_tcp_entries(table, table->head, table->tail->prev_entry, ch,
logging, logfile);
- update_panels();
- doupdate();
- tx_colorwin(table->tcpscreen);
-
- tcptmp1 = table->firstvisible = table->head;
+ table->firstvisible = table->head;
+ struct tcptableent *ptmp = table->head;
*idx = 1;
- idxtmp = 0;
- while ((tcptmp1 != NULL) && (idxtmp <= table->imaxy - 1)) {
- if (idxtmp++ <= table->imaxy - 1)
- table->lastvisible = tcptmp1;
- tcptmp1 = tcptmp1->next_entry;
+ while (ptmp && ((int)ptmp->index <= getmaxy(table->tcpscreen))) {
+ table->lastvisible = ptmp;
+ ptmp = ptmp->next_entry;
}
-
}
/*
diff --git a/src/serv.c b/src/serv.c
index 955b6bb..90bac8c 100644
--- a/src/serv.c
+++ b/src/serv.c
@@ -590,9 +590,6 @@ static void quicksort_port_entries(struct portlist *table,
static void sortportents(struct portlist *list, int command)
{
- struct portlistent *ptemp1;
- int idxtmp;
-
if (!(list->head))
return;
@@ -605,15 +602,11 @@ static void sortportents(struct portlist *list, int command)
quicksort_port_entries(list, list->head, list->tail, command);
- ptemp1 = list->firstvisible = list->head;
- idxtmp = 1;
-
- while ((ptemp1) && (idxtmp <= LINES - 5)) { /* printout */
- printportent(list, ptemp1);
- if (idxtmp <= LINES - 5)
- list->lastvisible = ptemp1;
- ptemp1 = ptemp1->next_entry;
- idxtmp++;
+ list->firstvisible = list->head;
+ struct portlistent *ptmp = list->head;
+ while (ptmp && ((int)ptmp->idx <= getmaxy(list->win))) {
+ list->lastvisible = ptmp;
+ ptmp = ptmp->next_entry;
}
}
--
1.9.1