]> code.citadel.org Git - citadel.git/blobdiff - citadel/clientsocket.c
* misc bugfixes and cleanups
[citadel.git] / citadel / clientsocket.c
index 710df1a3fcde4f057e607b291618380dc33fdd63..ba423c4353ad01d91ef9c0bc789d96f42bd3e8c5 100644 (file)
@@ -76,21 +76,11 @@ int sock_connect(char *host, char *service, char *protocol)
                return(-1);
        }
 
-/* FIX ... the alarm clock is a problem for multithreaded programs because all
- * threads receive the signal.
-       signal(SIGALRM, timeout);
-       alarm(30);
- */
-
        if (connect(s, (struct sockaddr *) &sin, sizeof(sin)) < 0) {
                lprintf(3, "can't connect to %s.%s: %s\n",
                        host, service, strerror(errno));
                return(-1);
        }
-/*
-       alarm(0);
-       signal(SIGALRM, SIG_IGN);
- */
 
        return (s);
 }
@@ -159,6 +149,7 @@ int sock_gets(int sock, char *buf)
 
        /* Strip any trailing CR and LF characters.
         */
+       buf[i] = 0;
        while ( (strlen(buf)>0)
              && ((buf[strlen(buf)-1]==13)
              || (buf[strlen(buf)-1]==10)) ) {