]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Fix an error and a warning.
authorGuy Harris <[email protected]>
Fri, 8 Jun 2012 05:24:04 +0000 (22:24 -0700)
committerGuy Harris <[email protected]>
Fri, 8 Jun 2012 05:24:04 +0000 (22:24 -0700)
Use a separate variable to index through the hash digest, not the
variable used to index through the packet.

Make some variables holding one-byte quantities u_int rather than u_char
while we're at it - not much use in *requiring* them to fit into 8 bits
(the code might be better if we don't, and that eliminates a warning).

print-babel.c

index 58aa61c9dbce698baf7d44bb278ed9cbd7a2c3bd..52f41b66dbc8bd3c0287732eac9d9fc11b0dde8d 100644 (file)
@@ -201,7 +201,7 @@ babel_print_v2(const u_char *cp, u_int length) {
     i = 0;
     while(i < bodylen) {
         const u_char *message;
-        u_char type, len;
+        u_int type, len;
 
         message = cp + 4 + i;
         TCHECK2(*message, 2);
@@ -410,12 +410,12 @@ babel_print_v2(const u_char *cp, u_int length) {
             if(!vflag)
                 printf(" hd");
             else {
-                unsigned i;
+                unsigned j;
                 printf("\n\tHash Digest ");
                 if(len < 18) goto corrupt;
                 printf("key ID %u digest-%u '", EXTRACT_16BITS(message + 2), len - 2);
-                for (i = 0; i < len - 2; i++)
-                    printf ("%02X", message[4 + i]);
+                for (j = 0; j < len - 2; j++)
+                    printf ("%02X", message[4 + j]);
                 printf("'");
             }
         }