2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 14:07:59 +00:00

1086. [port] libbind: sunos: old sprintf.

This commit is contained in:
Mark Andrews
2001-11-01 00:57:49 +00:00
parent 4b711da3c2
commit e9ca87459a
2 changed files with 15 additions and 6 deletions

View File

@@ -1,3 +1,5 @@
1086. [port] libbind: sunos: old sprintf.
1085. [port] libbind: solaris: sys_nerr and sys_errlist do not 1085. [port] libbind: solaris: sys_nerr and sys_errlist do not
exist when compiling in 64 bit mode. exist when compiling in 64 bit mode.

View File

@@ -16,7 +16,7 @@
*/ */
#ifndef lint #ifndef lint
static const char rcsid[] = "$Id: ns_name.c,v 1.3 2001/05/07 06:07:44 marka Exp $"; static const char rcsid[] = "$Id: ns_name.c,v 1.4 2001/11/01 00:57:49 marka Exp $";
#endif #endif
#include "port_before.h" #include "port_before.h"
@@ -35,6 +35,12 @@ static const char rcsid[] = "$Id: ns_name.c,v 1.3 2001/05/07 06:07:44 marka Exp
#include "port_after.h" #include "port_after.h"
#ifdef SPRINTF_CHAR
# define SPRINTF(x) strlen(sprintf/**/x)
#else
# define SPRINTF(x) ((size_t)sprintf x)
#endif
#define NS_TYPE_ELT 0x40 /* EDNS0 extended label type */ #define NS_TYPE_ELT 0x40 /* EDNS0 extended label type */
#define DNS_LABELTYPE_BITSTRING 0x41 #define DNS_LABELTYPE_BITSTRING 0x41
@@ -790,17 +796,18 @@ decode_bitstring(const char **cpp, char *dn, const char *eom)
return(-1); return(-1);
cp++; cp++;
dn += sprintf(dn, "\\[x"); dn += SPRINTF((dn, "\\[x"));
for (b = blen; b > 7; b -= 8, cp++) for (b = blen; b > 7; b -= 8, cp++)
dn += sprintf(dn, "%02x", *cp & 0xff); dn += SPRINTF((dn, "%02x", *cp & 0xff));
if (b > 4) { if (b > 4) {
tc = *cp++; tc = *cp++;
dn += sprintf(dn, "%02x", tc & (0xff << (8 - b))); dn += SPRINTF((dn, "%02x", tc & (0xff << (8 - b))));
} else if (b > 0) { } else if (b > 0) {
tc = *cp++; tc = *cp++;
dn += sprintf(dn, "%1x", ((tc >> 4) & 0x0f) & (0x0f << (4 - b))); dn += SPRINTF((dn, "%1x",
((tc >> 4) & 0x0f) & (0x0f << (4 - b))));
} }
dn += sprintf(dn, "/%d]", blen); dn += SPRINTF((dn, "/%d]", blen));
*cpp = cp; *cpp = cp;
return(dn - beg); return(dn - beg);