]> code.citadel.org Git - citadel.git/blobdiff - citadel/locate_host.c
* Removed all of the thread cancellation cruft that is no longer necessary
[citadel.git] / citadel / locate_host.c
index 5731e5d76b3809157c1b9d84c1508562cda1a600..b4f5cdbadcbb810385a4908cc26f82219f4b1a51 100644 (file)
 #include <limits.h>
 #include <netdb.h>
 #include <string.h>
-#ifdef HAVE_PTHREAD_H
-#include <pthread.h>
-#endif
 #include "citadel.h"
 #include "server.h"
 #include "locate_host.h"
 #include "config.h"
+#include "tools.h"
 
 void locate_host(char *tbuf, const struct in_addr *addr)
 {
@@ -55,7 +53,7 @@ void locate_host(char *tbuf, const struct in_addr *addr)
        for (; *ch->h_addr_list; ch->h_addr_list++)
                if (!memcmp(*ch->h_addr_list, addr,
                            sizeof *addr)) {
-                       safestrncpy(tbuf, ch->h_name, 24);
+                       safestrncpy(tbuf, ch->h_name, 25);
                        goto end;
                }
        goto bad_dns;           /* they were spoofing. report a numeric IP
@@ -67,5 +65,5 @@ void locate_host(char *tbuf, const struct in_addr *addr)
        end_critical_section(S_NETDB);
 #endif
 
-       tbuf[24] = 0;
+       tbuf[25] = 0;
 }