X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/3e3e6d2ef4c1b120077378fe32dc0a88ee81f38e..ca94c264bf987ff4ec7adffabca2a8d2e4e07efb:/print-timed.c diff --git a/print-timed.c b/print-timed.c index 1f7bc823..f9a5835a 100644 --- a/print-timed.c +++ b/print-timed.c @@ -45,7 +45,7 @@ struct tsp { struct tsp_timeval tspu_time; nd_int8_t tspu_hopcnt; } tsp_u; - nd_byte tsp_name[256]; + nd_byte tsp_name[256]; /* null-terminated string up to 256 */ }; #define tsp_time tsp_u.tspu_time @@ -82,7 +82,6 @@ struct tsp { #define TSPTYPENUMBER 25 -static const char tstr[] = "[|timed]"; static const char *tsptype[TSPTYPENUMBER] = { "ANY", "ADJTIME", "ACK", "MASTERREQ", "MASTERACK", "SETTIME", "MASTERUP", @@ -139,10 +138,11 @@ timed_print(netdissect_options *ndo, break; } ND_PRINT(" name "); - if (nd_print(ndo, (const u_char *)tsp->tsp_name, (const u_char *)tsp->tsp_name + sizeof(tsp->tsp_name))) + if (nd_printzp(ndo, tsp->tsp_name, sizeof(tsp->tsp_name), + ndo->ndo_snapend)) goto trunc; return; trunc: - ND_PRINT(" %s", tstr); + nd_print_trunc(ndo); }