From a0c6ae3a0bdcbc8d7842795eff27e47498c14e2f Mon Sep 17 00:00:00 2001 From: pdw <> Date: Mon, 25 Mar 2002 22:58:59 +0000 Subject: [PATCH] Fixed sorting. --- ui.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ui.c b/ui.c index dc06e06..f1103b4 100644 --- a/ui.c +++ b/ui.c @@ -37,9 +37,15 @@ extern int history_len; void ui_finish(); int screen_line_compare(void* a, void* b) { + int i; host_pair_line* aa = (host_pair_line*)a; host_pair_line* bb = (host_pair_line*)b; - return(aa->recv[0] + aa->sent[0] < bb->recv[0] + bb->sent[0]); + for(i = 0; i < HISTORY_DIVISIONS; i++) { + if(aa->recv[i] + aa->sent[i] != bb->recv[i] + bb->sent[i]) { + return(aa->recv[i] + aa->sent[i] < bb->recv[i] + bb->sent[i]); + } + } + return 1; } void readable_size(float n, char* buf, int bsize, int ksize) {