Silenced some compiler warnings
authorArt Cancro <ajc@citadel.org>
Sat, 18 Mar 2006 03:45:39 +0000 (03:45 +0000)
committerArt Cancro <ajc@citadel.org>
Sat, 18 Mar 2006 03:45:39 +0000 (03:45 +0000)
citadel/citadel_dirs.c
citadel/citserver.c
citadel/locate_host.c

index ffa9df951b8400b199e1192dfce086b773e7e5e0..8a41feadef7cfb498cd0de39b5345adcfd46e883 100644 (file)
@@ -80,8 +80,8 @@ int home_specified = 0;
 
 void calc_dirs_n_files(int relh, int home, const char *relhome,const char  *ctdldir)
 {
-       const char* basedir;
-       char dirbuffer[PATH_MAX]="";
+       const char* basedir = "";
+       char dirbuffer[PATH_MAX] = "";
 
        /*
         * Ok, we keep our binaries either in the citadel base dir,
index 006daec97f5c2e81d2cab6fd7860ee4acdd09e97..e394b2790c81c12781c9c69de6e2b27680ae8ede 100644 (file)
@@ -31,7 +31,6 @@
 #include <dirent.h>
 #include <errno.h>
 #include <limits.h>
-/* #include <dlfcn.h> */
 #include <netdb.h>
 #include <sys/types.h>
 #include <sys/socket.h>
@@ -817,7 +816,7 @@ void generate_nonce(struct CitContext *con) {
  */
 void begin_session(struct CitContext *con)
 {
-       int len;
+       socklen_t len;
        struct sockaddr_in sin;
 
        /* 
@@ -844,11 +843,12 @@ void begin_session(struct CitContext *con)
        con->cs_host[sizeof con->cs_host - 1] = 0;
        len = sizeof sin;
        if (!CC->is_local_socket) {
-               if (!getpeername(con->client_socket,
-                  (struct sockaddr *) &sin, &len))     /* should be socklen_t but doesn't work on Macintosh */
+               if (!getpeername(con->client_socket, (struct sockaddr *) &sin, &len)) {
                        locate_host(con->cs_host, sizeof con->cs_host,
                                con->cs_addr, sizeof con->cs_addr,
-                               &sin.sin_addr);
+                               &sin.sin_addr
+                       );
+               }
        }
        else {
                strcpy(con->cs_host, "");
index 055d4d9d82692a9e8eaef2426b9d57878b9fb2a2..cb99a28fc540b9587144357229d0ac7b5093c35f 100644 (file)
@@ -185,8 +185,8 @@ int rblcheck_backend(char *domain, char *txtbuf, int txtbufsize) {
 
        /* Iterate over any multiple answers we might have. In
           this context, it's unlikely, but anyway. */
-       rp = result;
-       rend = result + RESULT_SIZE - 1;
+       rp = (u_char *) result;
+       rend = (u_char *) result + RESULT_SIZE - 1;
        while( cp < cend && rp < rend )
        {
                a = *cp++;