[Iftop-users] [PATCH] unlimited text output

Roman Hoog Antink rha at open.ch
Mon, 17 Mar 2014 11:50:55 +0100


This is a multi-part message in MIME format.
--------------090101030001050907020805
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

Hi Paul

Please consider this patch for 1.0pre5. It allows unlimited number of
lines in text output, using "iftop -t -L 0".

Thanks to Yan Chen for suggesting this tiny improvement.

Cheers,
Roman

--------------090101030001050907020805
Content-Type: text/x-patch;
 name="iftop-unlimited_text_output.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="iftop-unlimited_text_output.patch"

commit b60e5a020f8384eb8f5aef56b231116a60a3db4b
Author: Roman Hoog Antink <rha@open.ch>
Date:   Mon Mar 17 11:34:37 2014 +0100

    support unlimited text output

diff --git a/tui.c b/tui.c
index 31d4109..3b73ed9 100644
--- a/tui.c
+++ b/tui.c
@@ -73,7 +73,7 @@ void tui_print() {
   printf("\n");
 
   /* Traverse the list of all connections */
-  while((nn = sorted_list_next_item(&screen_list, nn)) != NULL && l < options.num_lines) {
+  while((nn = sorted_list_next_item(&screen_list, nn)) != NULL && (!options.num_lines || l < options.num_lines)) {
     /* Increment the line counter */
     l++;
 

--------------090101030001050907020805--