diff --git a/CHANGES b/CHANGES index 021599bb2a..3259370dd9 100644 --- a/CHANGES +++ b/CHANGES @@ -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. diff --git a/lib/bind/nameser/ns_name.c b/lib/bind/nameser/ns_name.c index bb9e43ed11..3fb35180c6 100644 --- a/lib/bind/nameser/ns_name.c +++ b/lib/bind/nameser/ns_name.c @@ -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);