diff options
author | Guy Harris <guy@alum.mit.edu> | 2018-01-29 15:48:55 -0800 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2018-01-29 15:48:55 -0800 |
commit | c499612a7f1024a183d0200ef5f1ea7fba63a3e4 (patch) | |
tree | 5ffc65612e07d03e445e58a02d9e349c13eb0af7 /print-lldp.c | |
parent | 1e120597d2cb5864d52ca99ca6e167f2454c3153 (diff) | |
download | tcpdump-c499612a7f1024a183d0200ef5f1ea7fba63a3e4.tar.gz |
Add nd_{v}snprintf() routines/wrappers.
Some versions of the MSVC runtime library have a non-C99-compliant
vsnprintf(), which we want to avoid. On Windows, use snprintf() and
vsnprintf() for VS 2015 and later, where they both exist in
C99-compliant forms, and wrap _{v}snprintf_s() otherwise (they're
guaranteed to do the null termination that we want).
Diffstat (limited to 'print-lldp.c')
-rw-r--r-- | print-lldp.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/print-lldp.c b/print-lldp.c index 1fdb8f25..e76260ec 100644 --- a/print-lldp.c +++ b/print-lldp.c @@ -1355,10 +1355,10 @@ lldp_network_addr_print(netdissect_options *ndo, const u_char *tptr, u_int len) } if (!pfunc) { - snprintf(buf, sizeof(buf), "AFI %s (%u), no AF printer !", + nd_snprintf(buf, sizeof(buf), "AFI %s (%u), no AF printer !", tok2str(af_values, "Unknown", af), af); } else { - snprintf(buf, sizeof(buf), "AFI %s (%u): %s", + nd_snprintf(buf, sizeof(buf), "AFI %s (%u): %s", tok2str(af_values, "Unknown", af), af, (*pfunc)(ndo, tptr+1)); } |