]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Declare all local variables before any executable statements.
authorGuy Harris <[email protected]>
Sun, 14 Aug 2011 22:29:49 +0000 (15:29 -0700)
committerGuy Harris <[email protected]>
Sun, 14 Aug 2011 22:29:49 +0000 (15:29 -0700)
Some C compilers let you get away with that C++-ism; not all do.

print-ppi.c

index b3b71f27435d3ce90158426a2c98a4d8bd2ce9eb..38873c84c5aeb35594cc891313d978c065f0e72a 100644 (file)
@@ -21,10 +21,11 @@ static inline void
 ppi_header_print(struct netdissect_options *ndo, const u_char *bp, u_int length)
 {
        const ppi_header_t *hdr;
-       hdr = (const ppi_header_t *)bp;
        u_int32_t dlt;
        u_int16_t len;
 
+       hdr = (const ppi_header_t *)bp;
+
        len = EXTRACT_16BITS(&hdr->ppi_len);
        dlt = EXTRACT_32BITS(&hdr->ppi_dlt);