[PATCH] BUGFIX: fix "Floating point exception" in tcplog_flowrate_msg()
by Vitezslav Samel
make sure interval is at least 1 (bug was made in
"tcplog_flowrate_msg(): cleanup and fix")
Reported-by: Erik K. <ummeegge(a)ipfire.org>
Signed-off-by: Vitezslav Samel <vitezslav(a)samel.cz>
---
src/tcptable.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/src/tcptable.c b/src/tcptable.c
index a4133d9..e217b19 100644
--- a/src/tcptable.c
+++ b/src/tcptable.c
@@ -437,6 +437,8 @@ static char *tcplog_flowrate_msg(struct tcptableent *entry, char *buf,
size_t bufsize)
{
time_t interval = time(NULL) - entry->conn_starttime;
+ if (interval < 1)
+ interval = 1;
char rbuf[64];
rate_print(entry->bcount / interval, rbuf, sizeof(rbuf));
--
1.7.8.4
10 years, 7 months
[PATCH 00/12] random cleanups and feature additions
by Vitezslav Samel
Vitezslav Samel (12):
use printw(win, "%*c", len, ' ') to print len spaces
use mvwprintw() instead of wmove()/wprintw() combo
tui/input.c: fix open coded padding printing
tx_operate_listbox(): remove unused keystroke parameter
tui/listbox.c: tx_operate_listbox(): remove unneeded check
tui/listbox.h: remove unused struct members
tui/listbox.c: allow scrolling listboxes with Home, End, PageUp and PageDown keys
tui/listbox.c: simplify tx_destroy_list()
ifstats.c: reduce params to printifentry()
ifstats.c: allow scrolling with Home, End, PageUp and PageDown keys
ifstats.c: call showrates() right after starting or scrolling the view
detstats.c: print broadcasts the same way as other protocols
src/deskman.c | 13 ++----
src/detstats.c | 43 ++++++++++++-----
src/fltmgr.c | 3 +-
src/hostmon.c | 53 +++++++--------------
src/ifstats.c | 111 +++++++++++++++++++--------------------------
src/itrafmon.c | 16 ++-----
src/landesc.c | 9 +---
src/options.c | 3 +-
src/othptab.c | 8 +---
src/pktsize.c | 9 +---
src/serv.c | 45 +++++-------------
src/tcptable.c | 30 ++++--------
src/timer.c | 3 +-
src/tui/input.c | 14 +-----
src/tui/listbox.c | 126 +++++++++++++++++++++++++++++-----------------------
src/tui/listbox.h | 9 +---
src/tui/menurt.c | 3 +-
src/tui/msgboxes.c | 3 +-
src/tui/winops.c | 7 +--
19 files changed, 218 insertions(+), 290 deletions(-)
--
1.7.8.4
10 years, 8 months