From 8d365bc5b045889046ddc2014e126733d8ace1ef Mon Sep 17 00:00:00 2001 From: Oliver Hartkopp Date: Mon, 16 Jul 2007 09:52:43 +0000 Subject: [PATCH] Added the blanking of 'old' data when the can_dlc decreases between two receiptions of the same can_id. Thanks to Andre Naujoks for the bug report. --- cansniffer.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/cansniffer.c b/cansniffer.c index ed3f869..c184e37 100644 --- a/cansniffer.c +++ b/cansniffer.c @@ -580,6 +580,7 @@ void print_snifline(int id){ long diffsec = sniftab[id].currstamp.tv_sec - sniftab[id].laststamp.tv_sec; long diffusec = sniftab[id].currstamp.tv_usec - sniftab[id].laststamp.tv_usec; + int dlc_diff = sniftab[id].last.can_dlc - sniftab[id].current.can_dlc; int i,j; if (diffusec < 0) @@ -612,6 +613,16 @@ void print_snifline(int id){ if (binary_gap) putchar(' '); } + + /* + * when the can_dlc decreased (dlc_diff > 0), + * we need to blank the former data printout + */ + for (i=0; i 0), + * we need to blank the former data printout + */ + for (i=0; i