]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/getdxbyname.c
Cast char* argument to hh_to_c() to Byte*
[openldap] / libraries / libldap / getdxbyname.c
index 153b1119631abf4117e147b9bc9418233c7ef3a9..b6627cee98f977e4b7575619317ab855f1dd1ce9 100644 (file)
@@ -1,31 +1,30 @@
-#include "portable.h"
-
-#ifdef LDAP_DNS
 /*
+ * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
+ * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
+ */
+/*  Portions
  *  Copyright (c) 1995 Regents of the University of Michigan.
  *  All rights reserved.
  *
  * ldap_getdxbyname - retrieve DX records from the DNS (from TXT records for now)
  */
 
+#include "portable.h"
+
+#ifdef LDAP_API_FEATURE_X_OPENLDAP_V2_DNS
+
 #include <stdio.h>
 #include <stdlib.h>
-#include <ctype.h>
 
+#include <ac/ctype.h>
 #include <ac/socket.h>
 #include <ac/string.h>
 #include <ac/time.h>
 
-#include "lber.h"
-#include "ldap.h"
 #include "ldap-int.h"
 
 static char ** decode_answer LDAP_P(( unsigned char *answer, int len ));
 
-extern int h_errno;
-extern char *h_errlist[];
-
-
 #define MAX_TO_SORT    32
 
 
@@ -132,12 +131,12 @@ decode_answer( unsigned char *answer, int len )
                if ( *q >= 3 && strncasecmp( q + 1, "dx:", 3 ) == 0 ) {
                    txt_len = *q - 3;
                    r = q + 4;
-                   while ( isspace( *r )) { 
+                   while ( isspace( (unsigned char) *r )) { 
                        ++r;
                        --txt_len;
                    }
                    pref = 0;
-                   while ( isdigit( *r )) {
+                   while ( isdigit( (unsigned char) *r )) {
                        pref *= 10;
                        pref += ( *r - '0' );
                        ++r;
@@ -146,7 +145,7 @@ decode_answer( unsigned char *answer, int len )
                    if ( dx_count < MAX_TO_SORT - 1 ) {
                        dx_pref[ dx_count ] = pref;
                    }
-                   while ( isspace( *r )) { 
+                   while ( isspace( (unsigned char) *r )) { 
                        ++r;
                        --txt_len;
                    }
@@ -200,4 +199,4 @@ decode_answer( unsigned char *answer, int len )
     return( dxs );
 }
 
-#endif /* LDAP_DNS */
+#endif /* LDAP_API_FEATURE_X_OPENLDAP_V2_DNS */