]> git.sur5r.net Git - openldap/blobdiff - clients/gopher/go500.c
Server Side Sorting now RFC2891
[openldap] / clients / gopher / go500.c
index aebc0ce667fcd2f74fb5dfdde4d1f34f549c0c18..2b7c4ed6752af712cff475b8d0cdf4caf5c51fd2 100644 (file)
@@ -139,11 +139,12 @@ main( int argc, char **argv )
 #ifdef GO500_HOSTNAME
        strcpy( myhost, GO500_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
 
 #ifdef HAVE_SYSCONF
@@ -181,7 +182,7 @@ main( int argc, char **argv )
        if ( dosyslog ) {
 #ifdef LOG_LOCAL3
                openlog( myname, OPENLOG_OPTIONS, LOG_LOCAL3 );
-#else
+#elif LOG_DEBUG
                openlog( myname, OPENLOG_OPTIONS );
 #endif
        }
@@ -213,7 +214,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
                }
@@ -344,7 +345,7 @@ wait4child( int sig )
                ;       /* NULL */
 #endif
 
-       (void) SIGNAL( SIGCHLD, wait4child );
+       (void) SIGNAL_REINSTALL ( SIGCHLD, wait4child );
 }
 
 static void