]> The Tcpdump Group git mirrors - tcpdump/commitdiff
don't attempt to hexdump if length == 0
authorhannes <hannes>
Fri, 11 Oct 2002 10:34:07 +0000 (10:34 +0000)
committerhannes <hannes>
Fri, 11 Oct 2002 10:34:07 +0000 (10:34 +0000)
util.c

diff --git a/util.c b/util.c
index 9595dc10d10c13b75b30b0654fe00ba55d0923d4..2ad40daf0f6ec119035a8b6f8d771d165d355c7c 100644 (file)
--- a/util.c
+++ b/util.c
@@ -21,7 +21,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/util.c,v 1.79 2002-08-06 04:42:07 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/util.c,v 1.80 2002-10-11 10:34:07 hannes Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -206,6 +206,9 @@ print_unknown_data(const u_char *cp,const char *lf,int len)
 {
         int i;
 
+        if (len ==0)
+           return(0);
+
        printf("%s0x0000: ",lf);
        for(i=0;i<len;i++) {
            if (!TTEST2(*(cp+i), 1)) {