]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-tftp.c
Fix a bunch of de-constifications.
[tcpdump] / print-tftp.c
index 6324ea0e1ce30236d819e398354ffa39acdb6491..d996b8cfd69269cd7ef04ee6c4f72a7460111ab5 100644 (file)
@@ -21,7 +21,6 @@
  * Format and print trivial file transfer protocol packets.
  */
 
-#define NETDISSECT_REWORKED
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
@@ -131,12 +130,12 @@ tftp_print(netdissect_options *ndo,
        case RRQ:
        case WRQ:
        case OACK:
-               p = (u_char *)tp->th_stuff;
+               p = (const u_char *)tp->th_stuff;
                ND_PRINT((ndo, " "));
                /* Print filename or first option */
                if (opcode != OACK)
                        ND_PRINT((ndo, "\""));
-               i = fn_print(p, ndo->ndo_snapend);
+               i = fn_print(ndo, p, ndo->ndo_snapend);
                if (opcode != OACK)
                        ND_PRINT((ndo, "\""));
 
@@ -147,7 +146,7 @@ tftp_print(netdissect_options *ndo,
                        p++;
                        if (*p != '\0') {
                                ND_PRINT((ndo, " "));
-                               fn_print(p, ndo->ndo_snapend);
+                               fn_print(ndo, p, ndo->ndo_snapend);
                        }
                }
 
@@ -167,7 +166,7 @@ tftp_print(netdissect_options *ndo,
                ND_PRINT((ndo, " %s \"", tok2str(err2str, "tftp-err-#%d \"",
                                       EXTRACT_16BITS(&tp->th_code))));
                /* Print error message string */
-               i = fn_print((const u_char *)tp->th_data, ndo->ndo_snapend);
+               i = fn_print(ndo, (const u_char *)tp->th_data, ndo->ndo_snapend);
                ND_PRINT((ndo, "\""));
                if (i)
                        goto trunc;
@@ -180,6 +179,6 @@ tftp_print(netdissect_options *ndo,
        }
        return;
 trunc:
-       ND_PRINT((ndo, tstr));
+       ND_PRINT((ndo, "%s", tstr));
        return;
 }