]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Clean up signed vs. unsigned warnings.
authorGuy Harris <[email protected]>
Sun, 14 Jan 2018 22:15:18 +0000 (14:15 -0800)
committerGuy Harris <[email protected]>
Sun, 14 Jan 2018 22:15:18 +0000 (14:15 -0800)
If length is a uint8_t, subtracting 2 (a value of type int) from it
yields a value of type int, so compariing it against a u_int index
causes a signed vs. unsigned warning.

Make it a u_int instead (before we subtract 2 from it, we've already
checked to make sure it's >= 2, so we know the result will never be
negative).

print-nsh.c

index c97364b59cc20591326c7adafbfb46eac124aa58..636b4d3887f611f6f649eaa174ac6d71d3622603 100644 (file)
@@ -51,7 +51,7 @@ nsh_print(netdissect_options *ndo, const u_char *bp, u_int len)
     u_int n, vn;
     uint8_t ver;
     uint8_t flags;
-    uint8_t length;
+    u_int length;
     uint8_t md_type;
     uint8_t next_protocol;
     uint32_t service_path_id;