]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-atalk.c
Compile with -Wshadow
[tcpdump] / print-atalk.c
index 2816bfafa13edae6363489001cdc349d59df9ad4..09c0ff43b1e88d73722976c6af98de5826e7328c 100644 (file)
@@ -21,7 +21,6 @@
  * Format and print AppleTalk packets.
  */
 
-#define NETDISSECT_REWORKED
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
@@ -51,12 +50,12 @@ static const struct tok type2str[] = {
 
 struct aarp {
        uint16_t        htype, ptype;
-       uint8_t halen, palen;
+       uint8_t         halen, palen;
        uint16_t        op;
-       uint8_t hsaddr[6];
-       uint8_t psaddr[4];
-       uint8_t hdaddr[6];
-       uint8_t pdaddr[4];
+       uint8_t         hsaddr[6];
+       uint8_t         psaddr[4];
+       uint8_t         hdaddr[6];
+       uint8_t         pdaddr[4];
 };
 
 static void atp_print(netdissect_options *, const struct atATP *, u_int);
@@ -380,7 +379,7 @@ nbp_print(netdissect_options *ndo,
           register u_char snode, register u_char skt)
 {
        register const struct atNBPtuple *tp =
-               (const struct atNBPtuple *)((u_char *)np + nbpHeaderSize);
+               (const struct atNBPtuple *)((const u_char *)np + nbpHeaderSize);
        int i;
        const u_char *ep;
 
@@ -569,6 +568,8 @@ ataddr_string(netdissect_options *ndo,
                        tp->addr = i2;
                        tp->nxt = newhnamemem();
                        tp->name = strdup(nambuf);
+                       if (tp->name == NULL)
+                               error("ataddr_string: strdup(nambuf)");
                }
                fclose(fp);
        }
@@ -586,6 +587,8 @@ ataddr_string(netdissect_options *ndo,
                        (void)snprintf(nambuf, sizeof(nambuf), "%s.%d",
                            tp2->name, athost);
                        tp->name = strdup(nambuf);
+                       if (tp->name == NULL)
+                               error("ataddr_string: strdup(nambuf)");
                        return (tp->name);
                }
 
@@ -596,6 +599,8 @@ ataddr_string(netdissect_options *ndo,
        else
                (void)snprintf(nambuf, sizeof(nambuf), "%d", atnet);
        tp->name = strdup(nambuf);
+       if (tp->name == NULL)
+               error("ataddr_string: strdup(nambuf)");
 
        return (tp->name);
 }