From c499612a7f1024a183d0200ef5f1ea7fba63a3e4 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Mon, 29 Jan 2018 15:48:55 -0800 Subject: 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). --- print-nfs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'print-nfs.c') diff --git a/print-nfs.c b/print-nfs.c index 3407961f..85540693 100644 --- a/print-nfs.c +++ b/print-nfs.c @@ -332,11 +332,11 @@ nfsreply_print(netdissect_options *ndo, ND_TCHECK_4(rp->rm_xid); if (!ndo->ndo_nflag) { strlcpy(srcid, "nfs", sizeof(srcid)); - snprintf(dstid, sizeof(dstid), "%u", + nd_snprintf(dstid, sizeof(dstid), "%u", EXTRACT_BE_U_4(rp->rm_xid)); } else { - snprintf(srcid, sizeof(srcid), "%u", NFS_PORT); - snprintf(dstid, sizeof(dstid), "%u", + nd_snprintf(srcid, sizeof(srcid), "%u", NFS_PORT); + nd_snprintf(dstid, sizeof(dstid), "%u", EXTRACT_BE_U_4(rp->rm_xid)); } print_nfsaddr(ndo, bp2, srcid, dstid); -- cgit v1.2.1