summaryrefslogtreecommitdiff
path: root/addrtostr.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2018-01-29 15:48:55 -0800
committerGuy Harris <guy@alum.mit.edu>2018-01-29 15:48:55 -0800
commitc499612a7f1024a183d0200ef5f1ea7fba63a3e4 (patch)
tree5ffc65612e07d03e445e58a02d9e349c13eb0af7 /addrtostr.c
parent1e120597d2cb5864d52ca99ca6e167f2454c3153 (diff)
downloadtcpdump-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 'addrtostr.c')
-rw-r--r--addrtostr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/addrtostr.c b/addrtostr.c
index 62cc298a..3b573529 100644
--- a/addrtostr.c
+++ b/addrtostr.c
@@ -191,7 +191,7 @@ addrtostr6 (const void *src, char *dst, size_t size)
space_left -= added_space;
break;
}
- snprintfed = snprintf (dp, space_left, "%x", words[i]);
+ snprintfed = nd_snprintf (dp, space_left, "%x", words[i]);
if (snprintfed < 0)
return (NULL);
if ((size_t) snprintfed >= space_left)