From 94eb17efbd1ec81187fced585ab05ad0d0eb555c Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Mon, 17 Jun 2013 09:24:23 +0200 Subject: ax25dump: Fix warning about set but not used variables. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit gcc -DHAVE_CONFIG_H -I. -I.. -O2 -Wall -Wno-pointer-sign -MT ax25dump.o -MD -MP -MF .deps/ax25dump.Tpo -c -o ax25dump.o ax25dump.c ax25dump.c: In function ‘ax25_dump’: ax25dump.c:170:10: warning: ‘ns’ may be used uninitialized in this function [-Wmaybe-uninitialized] ax25dump.c:167:10: warning: ‘nr’ may be used uninitialized in this function [-Wmaybe-uninitialized] GCC isn't quite smart enough to figure out that this warning is bogus. Signed-off-by: Ralf Baechle --- listen/ax25dump.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/listen/ax25dump.c b/listen/ax25dump.c index a7b696c..5a870b7 100644 --- a/listen/ax25dump.c +++ b/listen/ax25dump.c @@ -373,6 +373,8 @@ char *pax25(char *buf, unsigned char *data) static int ftype(unsigned char *data, int *type, int *ns, int *nr, int *pf, int extseq) { + *ns = *nr = 0; /* To avoid warnings */ + if (extseq) { if ((*data & 0x01) == 0) { /* An I frame is an I-frame ... */ *type = I; -- cgit v1.2.3