2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-29 13:38:26 +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
exist when compiling in 64 bit mode.

View File

@ -16,7 +16,7 @@
*/
#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
#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"
#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 DNS_LABELTYPE_BITSTRING 0x41
@ -790,17 +796,18 @@ decode_bitstring(const char **cpp, char *dn, const char *eom)
return(-1);
cp++;
dn += sprintf(dn, "\\[x");
dn += SPRINTF((dn, "\\[x"));
for (b = blen; b > 7; b -= 8, cp++)
dn += sprintf(dn, "%02x", *cp & 0xff);
dn += SPRINTF((dn, "%02x", *cp & 0xff));
if (b > 4) {
tc = *cp++;
dn += sprintf(dn, "%02x", tc & (0xff << (8 - b)));
dn += SPRINTF((dn, "%02x", tc & (0xff << (8 - b))));
} else if (b > 0) {
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;
return(dn - beg);