From: Kurt Zeilenga Date: Thu, 20 Aug 1998 19:42:38 +0000 (+0000) Subject: removed lint X-Git-Tag: OPENLDAP_REL_ENG_1_0_0~10 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=cbc4b47f701b5d8ae3b097389bd675c189e0e513;p=openldap removed lint --- diff --git a/libraries/libavl/avl.c b/libraries/libavl/avl.c index 2614167709..6f89a15b00 100644 --- a/libraries/libavl/avl.c +++ b/libraries/libavl/avl.c @@ -18,6 +18,7 @@ static char avl_version[] = "AVL library version 1.0\n"; #include #include +#include #include "avl.h" #define ROTATERIGHT(x) { \ @@ -47,7 +48,7 @@ static char avl_version[] = "AVL library version 1.0\n"; */ static -ravl_insert( iroot, data, taller, fcmp, fdup, depth ) +int ravl_insert( iroot, data, taller, fcmp, fdup, depth ) Avlnode **iroot; caddr_t data; int *taller; @@ -200,7 +201,7 @@ ravl_insert( iroot, data, taller, fcmp, fdup, depth ) * NOTE: this routine may malloc memory */ -avl_insert( root, data, fcmp, fdup ) +int avl_insert( root, data, fcmp, fdup ) Avlnode **root; caddr_t data; IFP fcmp; @@ -216,11 +217,11 @@ avl_insert( root, data, fcmp, fdup ) * been shortened because of a deletion. */ -static +static int right_balance( root ) Avlnode **root; { - int shorter; + int shorter = -1; Avlnode *r, *l; switch( (*root)->avl_bf ) { @@ -282,10 +283,10 @@ right_balance( root ) */ static -left_balance( root ) +int left_balance( root ) Avlnode **root; { - int shorter; + int shorter = -1; Avlnode *r, *l; switch( (*root)->avl_bf ) { @@ -453,7 +454,7 @@ avl_delete( root, data, fcmp ) } static -avl_inapply( root, fn, arg, stopflag ) +int avl_inapply( root, fn, arg, stopflag ) Avlnode *root; IFP fn; caddr_t arg; @@ -477,7 +478,7 @@ avl_inapply( root, fn, arg, stopflag ) } static -avl_postapply( root, fn, arg, stopflag ) +int avl_postapply( root, fn, arg, stopflag ) Avlnode *root; IFP fn; caddr_t arg; @@ -500,7 +501,7 @@ avl_postapply( root, fn, arg, stopflag ) } static -avl_preapply( root, fn, arg, stopflag ) +int avl_preapply( root, fn, arg, stopflag ) Avlnode *root; IFP fn; caddr_t arg; @@ -531,7 +532,7 @@ avl_preapply( root, fn, arg, stopflag ) * of nodes. */ -avl_apply( root, fn, arg, stopflag, type ) +int avl_apply( root, fn, arg, stopflag, type ) Avlnode *root; IFP fn; caddr_t arg; @@ -564,7 +565,7 @@ avl_apply( root, fn, arg, stopflag, type ) * AVL_NOMORE is returned. */ -avl_prefixapply( root, data, fmatch, marg, fcmp, carg, stopflag ) +int avl_prefixapply( root, data, fmatch, marg, fcmp, carg, stopflag ) Avlnode *root; caddr_t data; IFP fmatch; @@ -613,7 +614,7 @@ avl_prefixapply( root, data, fmatch, marg, fcmp, carg, stopflag ) * number of items actually freed is returned. */ -avl_free( root, dfree ) +int avl_free( root, dfree ) Avlnode *root; IFP dfree; { @@ -700,7 +701,7 @@ static int avl_nextlist; /* ARGSUSED */ static -avl_buildlist( data, arg ) +int avl_buildlist( data, arg ) caddr_t data; int arg; { @@ -767,12 +768,12 @@ avl_getnext() return( avl_list[ avl_nextlist++ ] ); } -avl_dup_error() +int avl_dup_error() { return( -1 ); } -avl_dup_ok() +int avl_dup_ok() { return( 0 ); } diff --git a/libraries/liblber/io.c b/libraries/liblber/io.c index 99cc2f3999..731c0cf8f2 100644 --- a/libraries/liblber/io.c +++ b/libraries/liblber/io.c @@ -12,23 +12,17 @@ */ #include +#include #include +#include #if defined( DOS ) || defined( _WIN32 ) #include "msdos.h" #endif /* DOS || _WIN32 */ #ifdef MACOS -#include #include "macos.h" #else /* MACOS */ -#if defined(NeXT) || defined(VMS) -#include -#else /* next || vms */ -#ifndef __FreeBSD__ -#include -#endif -#endif /* next || vms */ #include #include #include @@ -303,7 +297,7 @@ ber_flush( Sockbuf *sb, BerElement *ber, int freeit ) #ifdef LDAP_DEBUG if ( lber_debug ) { fprintf( stderr, "ber_flush: %ld bytes to sd %ld%s\n", towrite, - sb->sb_sd, ber->ber_rwptr != ber->ber_buf ? " (re-flush)" + (long) sb->sb_sd, ber->ber_rwptr != ber->ber_buf ? " (re-flush)" : "" ); if ( lber_debug > 1 ) lber_bprint( ber->ber_rwptr, towrite ); @@ -421,14 +415,16 @@ void ber_dump( BerElement *ber, int inout ) { fprintf( stderr, "ber_dump: buf 0x%lx, ptr 0x%lx, end 0x%lx\n", - ber->ber_buf, ber->ber_ptr, ber->ber_end ); + (long) ber->ber_buf, + (long) ber->ber_ptr, + (long) ber->ber_end ); if ( inout == 1 ) { fprintf( stderr, " current len %ld, contents:\n", - ber->ber_end - ber->ber_ptr ); + (long) (ber->ber_end - ber->ber_ptr) ); lber_bprint( ber->ber_ptr, ber->ber_end - ber->ber_ptr ); } else { fprintf( stderr, " current len %ld, contents:\n", - ber->ber_ptr - ber->ber_buf ); + (long) (ber->ber_ptr - ber->ber_buf) ); lber_bprint( ber->ber_buf, ber->ber_ptr - ber->ber_buf ); } } @@ -439,9 +435,9 @@ ber_sos_dump( Seqorset *sos ) fprintf( stderr, "*** sos dump ***\n" ); while ( sos != NULLSEQORSET ) { fprintf( stderr, "ber_sos_dump: clen %ld first 0x%lx ptr 0x%lx\n", - sos->sos_clen, sos->sos_first, sos->sos_ptr ); + (long) sos->sos_clen, (long) sos->sos_first, (long) sos->sos_ptr ); fprintf( stderr, " current len %ld contents:\n", - sos->sos_ptr - sos->sos_first ); + (long) (sos->sos_ptr - sos->sos_first) ); lber_bprint( sos->sos_first, sos->sos_ptr - sos->sos_first ); sos = sos->sos_next; @@ -489,7 +485,7 @@ get_tag( Sockbuf *sb ) unsigned long ber_get_next( Sockbuf *sb, unsigned long *len, BerElement *ber ) { - unsigned long tag, netlen, toread; + unsigned long tag = 0, netlen, toread; unsigned char lc; long rc; int noctets, diff; diff --git a/libraries/libldap/abandon.c b/libraries/libldap/abandon.c index 377beb7eb3..64a3e419a5 100644 --- a/libraries/libldap/abandon.c +++ b/libraries/libldap/abandon.c @@ -11,6 +11,7 @@ static char copyright[] = "@(#) Copyright (c) 1990 Regents of the University of #include #include +#include #if !defined( MACOS ) && !defined( DOS ) #include @@ -23,7 +24,6 @@ static char copyright[] = "@(#) Copyright (c) 1990 Regents of the University of #endif /* DOS */ #ifdef MACOS -#include #include "macos.h" #endif /* MACOS */ diff --git a/libraries/libldap/cache.c b/libraries/libldap/cache.c index 7925f08fe0..2e47d68694 100644 --- a/libraries/libldap/cache.c +++ b/libraries/libldap/cache.c @@ -13,8 +13,9 @@ static char copyright[] = "@(#) Copyright (c) 1993 The Regents of the University #include #include -#ifdef MACOS #include + +#ifdef MACOS #include #include "macos.h" #else /* MACOS */ @@ -32,6 +33,7 @@ static char copyright[] = "@(#) Copyright (c) 1993 The Regents of the University #include #endif /* DOS */ #endif /* MACOS */ + #include "lber.h" #include "ldap.h" #include "ldap-int.h" @@ -139,8 +141,8 @@ ldap_flush_cache( LDAP *ld ) void ldap_uncache_request( LDAP *ld, int msgid ) { - Debug( LDAP_DEBUG_TRACE, "ldap_uncache_request %d ld_cache %x\n", - msgid, ld->ld_cache, 0 ); + Debug( LDAP_DEBUG_TRACE, "ldap_uncache_request %d ld_cache %lx\n", + msgid, (long) ld->ld_cache, 0 ); uncache_entry_or_req( ld, NULL, msgid ); } @@ -149,8 +151,8 @@ ldap_uncache_request( LDAP *ld, int msgid ) void ldap_uncache_entry( LDAP *ld, char *dn ) { - Debug( LDAP_DEBUG_TRACE, "ldap_uncache_entry %s ld_cache %x\n", - dn, ld->ld_cache, 0 ); + Debug( LDAP_DEBUG_TRACE, "ldap_uncache_entry %s ld_cache %lx\n", + dn, (long) ld->ld_cache, 0 ); uncache_entry_or_req( ld, dn, 0 ); } @@ -165,8 +167,8 @@ uncache_entry_or_req( LDAP *ld, LDAPMessage *m, *prev, *next; Debug( LDAP_DEBUG_TRACE, - "ldap_uncache_entry_or_req dn %s msgid %d ld_cache %x\n", - dn, msgid, ld->ld_cache ); + "ldap_uncache_entry_or_req dn %s msgid %d ld_cache %lx\n", + dn, msgid, (long) ld->ld_cache ); if ( ld->ld_cache == NULLLDCACHE ) { return; diff --git a/libraries/libldap/disptmpl.c b/libraries/libldap/disptmpl.c index be418309e9..1385ef587b 100644 --- a/libraries/libldap/disptmpl.c +++ b/libraries/libldap/disptmpl.c @@ -152,7 +152,7 @@ int ldap_init_templates_buf( char *buf, long buflen, struct ldap_disptmpl **tmpllistp ) { - int rc, version; + int rc=-1, version; char **toks; struct ldap_disptmpl *prevtmpl, *tmpl; @@ -457,9 +457,9 @@ read_next_tmpl( char **bufp, long *blenp, struct ldap_disptmpl **tmplp, int i, j, tokcnt, samerow, adsource; char **toks, *itemopts; struct ldap_disptmpl *tmpl; - struct ldap_oclist *ocp, *prevocp; - struct ldap_adddeflist *adp, *prevadp; - struct ldap_tmplitem *rowp, *ip, *previp; + struct ldap_oclist *ocp, *prevocp = NULL; + struct ldap_adddeflist *adp, *prevadp = NULL; + struct ldap_tmplitem *rowp = NULL, *ip, *previp = NULL; *tmplp = NULL; diff --git a/libraries/libldap/error.c b/libraries/libldap/error.c index b59563ef88..f731ec8ecd 100644 --- a/libraries/libldap/error.c +++ b/libraries/libldap/error.c @@ -1,8 +1,7 @@ #include #include -#ifdef MACOS #include -#else /* MACOS */ + #if defined( DOS ) || defined( _WIN32 ) #include #include "msdos.h" @@ -10,7 +9,7 @@ #include #include #endif /* DOS */ -#endif /* MACOS */ + #include "lber.h" #include "ldap.h" @@ -20,53 +19,53 @@ struct ldaperror { }; static struct ldaperror ldap_errlist[] = { - LDAP_SUCCESS, "Success", - LDAP_OPERATIONS_ERROR, "Operations error", - LDAP_PROTOCOL_ERROR, "Protocol error", - LDAP_TIMELIMIT_EXCEEDED, "Timelimit exceeded", - LDAP_SIZELIMIT_EXCEEDED, "Sizelimit exceeded", - LDAP_COMPARE_FALSE, "Compare false", - LDAP_COMPARE_TRUE, "Compare true", - LDAP_STRONG_AUTH_NOT_SUPPORTED, "Strong authentication not supported", - LDAP_STRONG_AUTH_REQUIRED, "Strong authentication required", - LDAP_PARTIAL_RESULTS, "Partial results and referral received", - LDAP_NO_SUCH_ATTRIBUTE, "No such attribute", - LDAP_UNDEFINED_TYPE, "Undefined attribute type", - LDAP_INAPPROPRIATE_MATCHING, "Inappropriate matching", - LDAP_CONSTRAINT_VIOLATION, "Constraint violation", - LDAP_TYPE_OR_VALUE_EXISTS, "Type or value exists", - LDAP_INVALID_SYNTAX, "Invalid syntax", - LDAP_NO_SUCH_OBJECT, "No such object", - LDAP_ALIAS_PROBLEM, "Alias problem", - LDAP_INVALID_DN_SYNTAX, "Invalid DN syntax", - LDAP_IS_LEAF, "Object is a leaf", - LDAP_ALIAS_DEREF_PROBLEM, "Alias dereferencing problem", - LDAP_INAPPROPRIATE_AUTH, "Inappropriate authentication", - LDAP_INVALID_CREDENTIALS, "Invalid credentials", - LDAP_INSUFFICIENT_ACCESS, "Insufficient access", - LDAP_BUSY, "DSA is busy", - LDAP_UNAVAILABLE, "DSA is unavailable", - LDAP_UNWILLING_TO_PERFORM, "DSA is unwilling to perform", - LDAP_LOOP_DETECT, "Loop detected", - LDAP_NAMING_VIOLATION, "Naming violation", - LDAP_OBJECT_CLASS_VIOLATION, "Object class violation", - LDAP_NOT_ALLOWED_ON_NONLEAF, "Operation not allowed on nonleaf", - LDAP_NOT_ALLOWED_ON_RDN, "Operation not allowed on RDN", - LDAP_ALREADY_EXISTS, "Already exists", - LDAP_NO_OBJECT_CLASS_MODS, "Cannot modify object class", - LDAP_RESULTS_TOO_LARGE, "Results too large", - LDAP_OTHER, "Unknown error", - LDAP_SERVER_DOWN, "Can't contact LDAP server", - LDAP_LOCAL_ERROR, "Local error", - LDAP_ENCODING_ERROR, "Encoding error", - LDAP_DECODING_ERROR, "Decoding error", - LDAP_TIMEOUT, "Timed out", - LDAP_AUTH_UNKNOWN, "Unknown authentication method", - LDAP_FILTER_ERROR, "Bad search filter", - LDAP_USER_CANCELLED, "User cancelled operation", - LDAP_PARAM_ERROR, "Bad parameter to an ldap routine", - LDAP_NO_MEMORY, "Out of memory", - -1, 0 + {LDAP_SUCCESS, "Success" }, + {LDAP_OPERATIONS_ERROR, "Operations error" }, + {LDAP_PROTOCOL_ERROR, "Protocol error" }, + {LDAP_TIMELIMIT_EXCEEDED, "Timelimit exceeded" }, + {LDAP_SIZELIMIT_EXCEEDED, "Sizelimit exceeded" }, + {LDAP_COMPARE_FALSE, "Compare false" }, + {LDAP_COMPARE_TRUE, "Compare true" }, + {LDAP_STRONG_AUTH_NOT_SUPPORTED, "Strong authentication not supported" }, + {LDAP_STRONG_AUTH_REQUIRED, "Strong authentication required" }, + {LDAP_PARTIAL_RESULTS, "Partial results and referral received" }, + {LDAP_NO_SUCH_ATTRIBUTE, "No such attribute" }, + {LDAP_UNDEFINED_TYPE, "Undefined attribute type" }, + {LDAP_INAPPROPRIATE_MATCHING, "Inappropriate matching" }, + {LDAP_CONSTRAINT_VIOLATION, "Constraint violation" }, + {LDAP_TYPE_OR_VALUE_EXISTS, "Type or value exists" }, + {LDAP_INVALID_SYNTAX, "Invalid syntax" }, + {LDAP_NO_SUCH_OBJECT, "No such object" }, + {LDAP_ALIAS_PROBLEM, "Alias problem" }, + {LDAP_INVALID_DN_SYNTAX, "Invalid DN syntax" }, + {LDAP_IS_LEAF, "Object is a leaf" }, + {LDAP_ALIAS_DEREF_PROBLEM, "Alias dereferencing problem" }, + {LDAP_INAPPROPRIATE_AUTH, "Inappropriate authentication" }, + {LDAP_INVALID_CREDENTIALS, "Invalid credentials" }, + {LDAP_INSUFFICIENT_ACCESS, "Insufficient access" }, + {LDAP_BUSY, "DSA is busy" }, + {LDAP_UNAVAILABLE, "DSA is unavailable" }, + {LDAP_UNWILLING_TO_PERFORM, "DSA is unwilling to perform" }, + {LDAP_LOOP_DETECT, "Loop detected" }, + {LDAP_NAMING_VIOLATION, "Naming violation" }, + {LDAP_OBJECT_CLASS_VIOLATION, "Object class violation" }, + {LDAP_NOT_ALLOWED_ON_NONLEAF, "Operation not allowed on nonleaf" }, + {LDAP_NOT_ALLOWED_ON_RDN, "Operation not allowed on RDN" }, + {LDAP_ALREADY_EXISTS, "Already exists" }, + {LDAP_NO_OBJECT_CLASS_MODS, "Cannot modify object class" }, + {LDAP_RESULTS_TOO_LARGE, "Results too large" }, + {LDAP_OTHER, "Unknown error" }, + {LDAP_SERVER_DOWN, "Can't contact LDAP server" }, + {LDAP_LOCAL_ERROR, "Local error" }, + {LDAP_ENCODING_ERROR, "Encoding error" }, + {LDAP_DECODING_ERROR, "Decoding error" }, + {LDAP_TIMEOUT, "Timed out" }, + {LDAP_AUTH_UNKNOWN, "Unknown authentication method" }, + {LDAP_FILTER_ERROR, "Bad search filter" }, + {LDAP_USER_CANCELLED, "User cancelled operation" }, + {LDAP_PARAM_ERROR, "Bad parameter to an ldap routine" }, + {LDAP_NO_MEMORY, "Out of memory" }, + {-1, 0 } }; char * diff --git a/libraries/libldap/getdn.c b/libraries/libldap/getdn.c index 2ea0d037c4..b213c89948 100644 --- a/libraries/libldap/getdn.c +++ b/libraries/libldap/getdn.c @@ -12,8 +12,9 @@ static char copyright[] = "@(#) Copyright (c) 1990 Regents of the University of #include #include #include -#ifdef MACOS #include + +#ifdef MACOS #include "macos.h" #else /* MACOS */ #if defined( DOS ) || defined( _WIN32 ) diff --git a/libraries/libldap/getdxbyname.c b/libraries/libldap/getdxbyname.c index 833af5adae..ed5dcf4fe1 100644 --- a/libraries/libldap/getdxbyname.c +++ b/libraries/libldap/getdxbyname.c @@ -91,9 +91,11 @@ decode_answer( unsigned char *answer, int len ) int dx_pref[ MAX_TO_SORT ]; #ifdef LDAP_DEBUG +#ifdef notdef if ( ldap_debug & LDAP_DEBUG_PACKETS ) { -/* __p_query( answer ); /* */ + __p_query( answer ); } +#endif #endif /* LDAP_DEBUG */ dxs = NULL; diff --git a/libraries/libldap/getvalues.c b/libraries/libldap/getvalues.c index 55102be8ab..52802aa6ca 100644 --- a/libraries/libldap/getvalues.c +++ b/libraries/libldap/getvalues.c @@ -12,8 +12,9 @@ static char copyright[] = "@(#) Copyright (c) 1990 Regents of the University of #include #include #include -#ifdef MACOS #include + +#ifdef MACOS #include "macos.h" #else /* MACOS */ #if defined( DOS ) || defined( _WIN32 ) diff --git a/libraries/libldap/kbind.c b/libraries/libldap/kbind.c index 6ed05253c0..cfccc36dd6 100644 --- a/libraries/libldap/kbind.c +++ b/libraries/libldap/kbind.c @@ -13,9 +13,9 @@ static char copyright[] = "@(#) Copyright (c) 1993 Regents of the University of #include #include +#include #ifdef MACOS -#include #include "macos.h" #else /* MACOS */ #ifdef DOS diff --git a/libraries/libldap/open.c b/libraries/libldap/open.c index a145ca0783..974a45ac04 100644 --- a/libraries/libldap/open.c +++ b/libraries/libldap/open.c @@ -11,15 +11,14 @@ static char copyright[] = "@(#) Copyright (c) 1995 Regents of the University of #include #include +#include #ifdef MACOS -#include #include "macos.h" #endif /* MACOS */ #if defined( DOS ) || defined( _WIN32 ) #include "msdos.h" -#include #endif /* DOS */ #if !defined(MACOS) && !defined(DOS) && !defined( _WIN32 ) @@ -167,7 +166,8 @@ int open_ldap_connection( LDAP *ld, Sockbuf *sb, char *host, int defport, char **krbinstancep, int async ) { - int rc, port; + int rc = -1; + int port; char *p, *q, *r; char *curhost, hostname[ 2*MAXHOSTNAMELEN ]; diff --git a/libraries/libldap/os-ip.c b/libraries/libldap/os-ip.c index c4c3cd6dbb..cc358ceefc 100644 --- a/libraries/libldap/os-ip.c +++ b/libraries/libldap/os-ip.c @@ -10,6 +10,7 @@ static char copyright[] = "@(#) Copyright (c) 1995 Regents of the University of #endif #include +#include #include #include @@ -21,7 +22,9 @@ static char copyright[] = "@(#) Copyright (c) 1995 Regents of the University of #include #include #include +#include #include +#include #endif /* _WIN32 */ #ifdef _AIX #include @@ -29,6 +32,7 @@ static char copyright[] = "@(#) Copyright (c) 1995 Regents of the University of #ifdef VMS #include "ucx_select.h" #endif /* VMS */ + #include "portable.h" #include "lber.h" #include "ldap.h" @@ -77,9 +81,10 @@ ldap_connect_to_host( Sockbuf *sb, char *host, unsigned long address, * XXX async is not used yet! */ { - int rc, i, s, connected, use_hp; + int rc, i, s = 0; + int connected, use_hp; struct sockaddr_in sin; - struct hostent *hp; + struct hostent *hp = NULL; #ifdef notyet #ifdef LDAP_REFERRALS int status; /* for ioctl call */ diff --git a/libraries/libldap/request.c b/libraries/libldap/request.c index 1bbfab9219..569621e3eb 100644 --- a/libraries/libldap/request.c +++ b/libraries/libldap/request.c @@ -11,15 +11,15 @@ static char copyright[] = "@(#) Copyright (c) 1995 Regents of the University of #include #include -#ifdef MACOS #include + +#ifdef MACOS #include #include "macos.h" #else /* MACOS */ #if defined( DOS ) || defined( _WIN32 ) #include "msdos.h" #include -#include #ifdef PCNFS #include #include diff --git a/libraries/libldap/result.c b/libraries/libldap/result.c index 8d4900f71a..34966dc17a 100644 --- a/libraries/libldap/result.c +++ b/libraries/libldap/result.c @@ -11,8 +11,9 @@ static char copyright[] = "@(#) Copyright (c) 1990 Regents of the University of #include #include -#ifdef MACOS #include + +#ifdef MACOS #include #include "macos.h" #else /* MACOS */ @@ -35,12 +36,14 @@ static char copyright[] = "@(#) Copyright (c) 1990 Regents of the University of #ifdef _AIX #include #endif /* _AIX */ -#include "portable.h" #endif /* DOS */ #endif /* MACOS */ #ifdef VMS #include "ucx_select.h" #endif + +#include "portable.h" + #include "lber.h" #include "ldap.h" #include "ldap-int.h" @@ -181,7 +184,8 @@ wait4msg( LDAP *ld, int msgid, int all, struct timeval *timeout, { int rc; struct timeval tv, *tvp; - long start_time, tmp_time; + time_t start_time = 0; + time_t tmp_time; #ifdef LDAP_REFERRALS LDAPConn *lc, *nextlc; #endif /* LDAP_REFERRALS */ @@ -201,7 +205,7 @@ wait4msg( LDAP *ld, int msgid, int all, struct timeval *timeout, } else { tv = *timeout; tvp = &tv; - start_time = (long)time( NULL ); + start_time = time( NULL ); } rc = -2; @@ -287,7 +291,7 @@ wait4msg( LDAP *ld, int msgid, int all, struct timeval *timeout, #endif /* !LDAP_REFERRALS */ if ( rc == -2 && tvp != NULL ) { - tmp_time = (long)time( NULL ); + tmp_time = time( NULL ); if (( tv.tv_sec -= ( tmp_time - start_time )) <= 0 ) { rc = 0; /* timed out */ ld->ld_errno = LDAP_TIMEOUT; diff --git a/libraries/libldap/search.c b/libraries/libldap/search.c index c9f984a511..a37e26884f 100644 --- a/libraries/libldap/search.c +++ b/libraries/libldap/search.c @@ -12,9 +12,9 @@ static char copyright[] = "@(#) Copyright (c) 1990 Regents of the University of #include #include #include +#include #ifdef MACOS -#include #include "macos.h" #endif /* MACOS */ @@ -27,6 +27,7 @@ static char copyright[] = "@(#) Copyright (c) 1990 Regents of the University of #include #include #endif + #include "lber.h" #include "ldap.h" #include "ldap-int.h" diff --git a/libraries/libldap/srchpref.c b/libraries/libldap/srchpref.c index 88c094ce76..d3942f4e9c 100644 --- a/libraries/libldap/srchpref.c +++ b/libraries/libldap/srchpref.c @@ -17,6 +17,7 @@ #include #include #include + #ifdef MACOS #include "macos.h" #else /* MACOS */ @@ -110,7 +111,7 @@ int ldap_init_searchprefs_buf( char *buf, long buflen, struct ldap_searchobj **solistp ) { - int rc, version; + int rc = -1, version; char **toks; struct ldap_searchobj *prevso, *so; diff --git a/libraries/libldap/test.c b/libraries/libldap/test.c index e9cc1266d2..293c4d9cd5 100644 --- a/libraries/libldap/test.c +++ b/libraries/libldap/test.c @@ -1,8 +1,9 @@ #include #include #include -#ifdef MACOS #include + +#ifdef MACOS #ifdef THINK_C #include #include @@ -287,7 +288,7 @@ main( #endif /* WINSOCK */ int argc, char **argv ) { - LDAP *ld; + LDAP *ld = NULL; int i, c, port, cldapflg, errflg, method, id, msgtype; char line[256], command1, command2, command3; char passwd[64], dn[256], rdn[64], attr[64], value[256]; diff --git a/libraries/libldap/tmplout.c b/libraries/libldap/tmplout.c index c53d935757..4dff3c8536 100644 --- a/libraries/libldap/tmplout.c +++ b/libraries/libldap/tmplout.c @@ -8,6 +8,7 @@ #include #include #include + #ifdef MACOS #include "macos.h" #else /* MACOS */ @@ -989,7 +990,7 @@ searchaction( LDAP *ld, char *buf, char *base, LDAPMessage *entry, char *dn, struct ldap_tmplitem *tip, int labelwidth, int rdncount, writeptype writeproc, void *writeparm, char *eol, char *urlprefix ) { - int err, lderr, i, count, html; + int err = 0, lderr, i, count, html; char **vals, **members; char *value, *filtpattern, *attr, *selectname; char *retattrs[2], filter[ 256 ]; diff --git a/libraries/libldap/tmpltest.c b/libraries/libldap/tmpltest.c index d108375790..5a0796b473 100644 --- a/libraries/libldap/tmpltest.c +++ b/libraries/libldap/tmpltest.c @@ -1,15 +1,16 @@ #include +#include #include -#include "lber.h" -#include "ldap.h" -#include "disptmpl.h" -#include "srchpref.h" #ifdef MACOS -#include #include #endif /* MACOS */ +#include "lber.h" +#include "ldap.h" +#include "disptmpl.h" +#include "srchpref.h" + #ifdef NEEDPROTOS void dump_tmpl( struct ldap_disptmpl *tmpl ); void dump_srchpref( struct ldap_searchobj *sp ); @@ -18,10 +19,8 @@ void dump_tmpl(); void dump_srchpref(); #endif /* NEEDPROTOS */ - #define NULLSTRINGIFNULL( s ) ( s == NULL ? "(null)" : s ) - int main( int argc, char **argv ) { diff --git a/libraries/libldap/ufn.c b/libraries/libldap/ufn.c index 5827ca12b7..0c10e593db 100644 --- a/libraries/libldap/ufn.c +++ b/libraries/libldap/ufn.c @@ -12,9 +12,9 @@ static char copyright[] = "@(#) Copyright (c) 1993 Regents of the University of #include #include #include +#include #ifdef MACOS -#include #include "macos.h" #else /* MACOS */ #if defined( DOS ) || defined( _WIN32 ) @@ -85,9 +85,9 @@ ldap_ufn_search_ctx( LDAP *ld, char **ufncomp, int ncomp, char *prefix, char **attrs, int attrsonly, LDAPMessage **res, cancelptype cancelproc, void *cancelparm, char *tag1, char *tag2, char *tag3 ) { - char *dn, *ftag; - char **dns; - int max, i, err, scope, phase, tries; + char *dn, *ftag = NULL; + char **dns = NULL; + int max, i, err, scope = 0, phase, tries; LDAPFiltInfo *fi; LDAPMessage *tmpcand; LDAPMessage *candidates; @@ -242,7 +242,7 @@ ldap_ufn_search_ct( LDAP *ld, char *ufn, char **attrs, int attrsonly, { char **ufncomp, **prefixcomp; char *pbuf; - int ncomp, pcomp, i, err; + int ncomp, pcomp, i, err = 0; /* initialize the getfilter stuff if it's not already */ if ( ld->ld_filtd == NULL && ldap_ufn_setfilter( ld, FILTERFILE ) diff --git a/libraries/libldap/unbind.c b/libraries/libldap/unbind.c index 69231f7db9..ac196f3b8d 100644 --- a/libraries/libldap/unbind.c +++ b/libraries/libldap/unbind.c @@ -11,8 +11,9 @@ static char copyright[] = "@(#) Copyright (c) 1990 Regents of the University of #include #include -#ifdef MACOS #include + +#ifdef MACOS #include "macos.h" #else /* MACOS */ #if defined( DOS ) || defined( _WIN32 ) diff --git a/libraries/libldap/url.c b/libraries/libldap/url.c index 204f2978ff..b1b60608b8 100644 --- a/libraries/libldap/url.c +++ b/libraries/libldap/url.c @@ -24,14 +24,13 @@ static char copyright[] = "@(#) Copyright (c) 1996 Regents of the University of #include #include #include +#include #ifdef MACOS -#include #include "macos.h" #endif /* MACOS */ #if defined( DOS ) || defined( _WIN32 ) -#include #include #include "msdos.h" #endif /* DOS || _WIN32 */