]> git.sur5r.net Git - openldap/blobdiff - clients/gopher/go500gw.c
initialize Sockbuf * to NULL
[openldap] / clients / gopher / go500gw.c
index fc9fa853ee784f3227122f6865941ae7723cf17f..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 */
@@ -370,7 +371,7 @@ wait4child( int sig )
                ;       /* NULL */
 #endif
 
-       (void) SIGNAL( SIGCHLD, wait4child );
+       (void) SIGNAL_REINSTALL ( SIGCHLD, wait4child );
 }
 
 static void