diff options
author | Guy Harris <guy@alum.mit.edu> | 2019-08-08 22:39:54 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2019-08-08 23:21:35 -0700 |
commit | 1ed63b5d0630a4b5b4a8d31174d9f3e95a970913 (patch) | |
tree | 47373d65dd7495380858f848fda5368d1dcb180c /addrtoname.c | |
parent | dfcccf43766e22aec8793b0a3f963d5ec5a52b80 (diff) | |
download | tcpdump-1ed63b5d0630a4b5b4a8d31174d9f3e95a970913.tar.gz |
Remove more old-compiler compensation.
We require an environment with a C99-compatible snprintf(), so we don't
need to work around older implementations. Make the configuration
process fail if we don't have snprintf() and vsnprintf().
We require at least VS 2015, so we don't have to check for _MSC_VER >=
1400. Make the build fail if we don't have at least VS 2015.
We apparently do, however, have to use __inline, as the VS 2015
documentation doesn't meaning plain old "inline". Update a comment.
Diffstat (limited to 'addrtoname.c')
-rw-r--r-- | addrtoname.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/addrtoname.c b/addrtoname.c index 1ba7e506..aa43be76 100644 --- a/addrtoname.c +++ b/addrtoname.c @@ -628,7 +628,7 @@ etheraddr_string(netdissect_options *ndo, const uint8_t *ep) } if (!ndo->ndo_nflag) { - nd_snprintf(cp, BUFSIZE - (2 + 5*3), " (oui %s)", + snprintf(cp, BUFSIZE - (2 + 5*3), " (oui %s)", tok2str(oui_values, "Unknown", oui)); } else *cp = '\0'; @@ -749,7 +749,7 @@ tcpport_string(netdissect_options *ndo, u_short port) tp->addr = i; tp->nxt = newhnamemem(ndo); - (void)nd_snprintf(buf, sizeof(buf), "%u", i); + (void)snprintf(buf, sizeof(buf), "%u", i); tp->name = strdup(buf); if (tp->name == NULL) (*ndo->ndo_error)(ndo, S_ERR_ND_MEM_ALLOC, @@ -771,7 +771,7 @@ udpport_string(netdissect_options *ndo, u_short port) tp->addr = i; tp->nxt = newhnamemem(ndo); - (void)nd_snprintf(buf, sizeof(buf), "%u", i); + (void)snprintf(buf, sizeof(buf), "%u", i); tp->name = strdup(buf); if (tp->name == NULL) (*ndo->ndo_error)(ndo, S_ERR_ND_MEM_ALLOC, @@ -829,7 +829,7 @@ init_servarray(netdissect_options *ndo) while (table->name) table = table->nxt; if (ndo->ndo_nflag) { - (void)nd_snprintf(buf, sizeof(buf), "%d", port); + (void)snprintf(buf, sizeof(buf), "%d", port); table->name = strdup(buf); } else table->name = strdup(sv->s_name); @@ -1333,7 +1333,7 @@ const char * ieee8021q_tci_string(const uint16_t tci) { static char buf[128]; - nd_snprintf(buf, sizeof(buf), "vlan %u, p %u%s", + snprintf(buf, sizeof(buf), "vlan %u, p %u%s", tci & 0xfff, tci >> 13, (tci & 0x1000) ? ", DEI" : ""); |