#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)res_debug.c 8.1 (Berkeley) 6/4/93";
-static char rcsid[] = "$Id: res_debug.c,v 1.2 1999/10/14 21:56:45 wsanchez Exp $";
+static char rcsid[] = "$Id: res_debug.c,v 1.5 2004/06/11 23:16:00 majka Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
#include <netinet/in.h>
#include <arpa/inet.h>
-#include <arpa/nameser.h>
+#include <arpa/nameser8_compat.h>
#include <stdio.h>
#include <netdb.h>
-#include <resolv.h>
+#include <resolv8_compat.h>
#if defined(BSD) && (BSD >= 199103)
# include <string.h>
#else
* Print answer records.
*/
sflag = (_res.pfcode & pflag);
- if (n = ntohs(cnt)) {
+ if ((n = ntohs(cnt))) {
if ((!_res.pfcode) ||
((sflag) && (_res.pfcode & RES_PRF_HEAD1)))
fprintf(file, hs);
/*
* Print question records.
*/
- if (n = ntohs(hp->qdcount)) {
+ if ((n = ntohs(hp->qdcount))) {
if ((!_res.pfcode) || (_res.pfcode & RES_PRF_QUES))
fprintf(file, ";; QUESTIONS:\n");
while (--n >= 0) {
const u_char *cp, *msg;
FILE *file;
{
- int type, class, dlen, n, c;
+ int type, class, n, c;
+ int dlen;
struct in_addr inaddr;
const u_char *cp1, *cp2;
u_int32_t tmpttl, t;
case T_HINFO:
case T_ISDN:
cp2 = cp + dlen;
- if (n = *cp++) {
+ if ((n = *cp++)) {
fprintf(file, "\t%.*s", n, cp);
cp += n;
}
(void) fputs("\t\"", file);
cp2 = cp1 + dlen;
while (cp < cp2) {
- if (n = (unsigned char) *cp++) {
+ if ((n = (unsigned char) *cp++)) {
for (c = n; c > 0 && cp < cp2; c--)
if ((*cp == '\n') || (*cp == '"')) {
(void) putc('\\', file);
putc('\n', file);
#endif
if (cp - cp1 != dlen) {
- fprintf(file, ";; packet size error (found %d, dlen was %d)\n",
- cp - cp1, dlen);
+#ifdef __LP64__
+ fprintf(file, ";; packet size error (found %ld, dlen was %d)\n", cp - cp1, dlen);
+#else
+ fprintf(file, ";; packet size error (found %d, dlen was %d)\n", cp - cp1, dlen);
+#endif
cp = NULL;
}
return (cp);