]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Don't cast away constness.
authorGuy Harris <[email protected]>
Sat, 14 Jan 2017 04:46:46 +0000 (20:46 -0800)
committerGuy Harris <[email protected]>
Sat, 14 Jan 2017 04:46:46 +0000 (20:46 -0800)
While we're at it, clean up white space, and cast a size_t to u_int,
rather than int, when passeing it to a routine that expects a u_int.

print-dhcp6.c

index 4b4ee7a8874da2470ad09ba5f6c9405f1d8cc8d3..1e249347fde500c90525a32f4517f2e12f5e61fa 100644 (file)
@@ -745,16 +745,15 @@ dhcp6opt_print(netdissect_options *ndo,
                case DH6OPT_NEW_POSIX_TIMEZONE: /* all three of these options */
                case DH6OPT_NEW_TZDB_TIMEZONE:  /* are encoded similarly */
                case DH6OPT_MUDURL:             /* although GMT might not work */
                case DH6OPT_NEW_POSIX_TIMEZONE: /* all three of these options */
                case DH6OPT_NEW_TZDB_TIMEZONE:  /* are encoded similarly */
                case DH6OPT_MUDURL:             /* although GMT might not work */
-                       if ( optlen < 5 ) {
-                         ND_PRINT((ndo," ?)"));
-                         break;
-                       }
-                       tp=(u_char *) (dh6o + 1);
-                       ND_PRINT((ndo,"="));
-                       fn_printn(ndo,tp,(int) optlen,NULL);
-                       ND_PRINT((ndo,")"));
+                       if (optlen < 5) {
+                               ND_PRINT((ndo, " ?)"));
+                               break;
+                       }
+                       tp = (const u_char *)(dh6o + 1);
+                       ND_PRINT((ndo, "="));
+                       fn_printn(ndo, tp, (u_int)optlen, NULL);
+                       ND_PRINT((ndo, ")"));
                        break;
                        break;
-                   
 
                default:
                        ND_PRINT((ndo, ")"));
 
                default:
                        ND_PRINT((ndo, ")"));