From dd4f8fc7116b1c80feabf2bffa03da6c523e09f4 Mon Sep 17 00:00:00 2001 From: "mcs%netscape.com" Date: Mon, 22 Apr 2002 17:42:22 +0000 Subject: [PATCH] Fix bug # 138627 - mktemp() warnings when building ldapsearch.exe. Use _mktemp() on Windows. Remove a couple of unused local variables. --- directory/c-sdk/ldap/clients/tools/ldapcmp.c | 4 ++-- directory/c-sdk/ldap/clients/tools/ldapsearch.c | 4 ++-- directory/c-sdk/ldap/clients/tools/ldaptool.h | 4 ++++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/directory/c-sdk/ldap/clients/tools/ldapcmp.c b/directory/c-sdk/ldap/clients/tools/ldapcmp.c index 00139c44d7d4..2949b8c6b67b 100644 --- a/directory/c-sdk/ldap/clients/tools/ldapcmp.c +++ b/directory/c-sdk/ldap/clients/tools/ldapcmp.c @@ -251,7 +251,7 @@ cmp2( LDAP *ld1, LDAP *ld2, LDAPMessage *e1, int findonly) { LDAPMessage *e2, *res; char *dn, *attrcmp; - int found=0, rc, msgid; + int found=0, rc; ATTR *a1, *a2; dn = ldap_get_dn( ld1, e1 ); @@ -546,7 +546,7 @@ print_entry( ld, entry, attrsonly ) ldaptool_get_tmp_dir(), a ); tmpfp = NULL; - if ( mktemp( tmpfname ) == NULL ) { + if ( LDAPTOOL_MKTEMP( tmpfname ) == NULL ) { perror( tmpfname ); } else if (( tmpfp = fopen( tmpfname, mode)) == NULL ) { perror( tmpfname ); diff --git a/directory/c-sdk/ldap/clients/tools/ldapsearch.c b/directory/c-sdk/ldap/clients/tools/ldapsearch.c index 6980a8eb4fd9..68b4dfd17b01 100644 --- a/directory/c-sdk/ldap/clients/tools/ldapsearch.c +++ b/directory/c-sdk/ldap/clients/tools/ldapsearch.c @@ -295,7 +295,7 @@ main( int argc, char **argv ) static void options_callback( int option, char *optarg ) { - char *s, *p, *temp_arg, *ps_ptr, *ps_arg; + char *s, *temp_arg, *ps_ptr, *ps_arg; int i=0; switch( option ) { @@ -910,7 +910,7 @@ print_entry( ld, entry, attrsonly ) #endif tmpfp = NULL; - if ( mktemp( tmpfname ) == NULL ) { + if ( LDAPTOOL_MKTEMP( tmpfname ) == NULL ) { perror( tmpfname ); } else if (( tmpfp = fopen( tmpfname, mode)) == NULL ) { perror( tmpfname ); diff --git a/directory/c-sdk/ldap/clients/tools/ldaptool.h b/directory/c-sdk/ldap/clients/tools/ldaptool.h index 863a5cc36c1d..b5500f7e3d9a 100644 --- a/directory/c-sdk/ldap/clients/tools/ldaptool.h +++ b/directory/c-sdk/ldap/clients/tools/ldaptool.h @@ -53,10 +53,14 @@ #define WIN32_LEAN_AND_MEAN #include extern int getopt (int argc, char *const *argv, const char *optstring); +#include /* for _mktemp() */ +#define LDAPTOOL_MKTEMP( p ) _mktemp( p ) #else #include #include #include + +#define LDAPTOOL_MKTEMP( p ) mktemp( p ) #endif #include