]> git.sur5r.net Git - openldap/blobdiff - clients/gopher/go500gw.c
initialize Sockbuf * to NULL
[openldap] / clients / gopher / go500gw.c
index c390b283cdb76d69dee158d83a9a02b8ae63ac07..efe5054d811d97c2bcb67c7e32d0f6f0c11fe69b 100644 (file)
@@ -176,11 +176,12 @@ main (int  argc, char **argv )
 #ifdef GO500GW_HOSTNAME
        strcpy( myhost, GO500GW_HOSTNAME );
 #else
-       if ( myhost[0] == '\0' && gethostname( myhost, sizeof(myhost) )
+       if ( myhost[0] == '\0' && gethostname( myhost, sizeof(myhost)-1 )
            == -1 ) {
                perror( "gethostname" );
                exit( EXIT_FAILURE );
        }
+       myhost[sizeof(myhost)-1] = '\0';
 #endif
 
        /* detach if stderr is redirected or no debugging */
@@ -236,7 +237,7 @@ main (int  argc, char **argv )
                        }
 
 #ifdef LDAP_PROCTITLE
-                       setproctitle( hp == NULL ? inet_ntoa( from.sin_addr ) :
+                       setproctitle( "%s", hp == NULL ? inet_ntoa( from.sin_addr ) :
                            hp->h_name );
 #endif
                }
@@ -370,7 +371,7 @@ wait4child( int sig )
                ;       /* NULL */
 #endif
 
-       (void) SIGNAL( SIGCHLD, wait4child );
+       (void) SIGNAL_REINSTALL ( SIGCHLD, wait4child );
 }
 
 static void
@@ -553,7 +554,7 @@ isnonleaf( LDAP *ld, char **oclist, char *dn )
                timeout.tv_usec = 0;
                ldap_set_option(ld, LDAP_OPT_SIZELIMIT, &sizelimit);
                if ( (rc = ldap_search_st( ld, dn, LDAP_SCOPE_ONELEVEL,
-                   "(objectClass=*)", attrs, 0, &timeout, &res ))
+                   NULL, attrs, 0, &timeout, &res ))
                    == LDAP_SUCCESS || rc == LDAP_SIZELIMIT_EXCEEDED ) {
                        sizelimit = LDAP_NO_LIMIT;
                        ldap_set_option(ld, LDAP_OPT_SIZELIMIT, &sizelimit);
@@ -703,7 +704,7 @@ make_scope( LDAP *ld, char *dn )
 
        timeout.tv_sec = GO500GW_TIMEOUT;
        timeout.tv_usec = 0;
-       if ( ldap_search_st( ld, dn, LDAP_SCOPE_BASE, "objectClass=*",
+       if ( ldap_search_st( ld, dn, LDAP_SCOPE_BASE, NULL,
            attrs, 0, &timeout, &res ) != LDAP_SUCCESS ) {
                return( -1 );
        }