]> jfr.im git - solanum.git/blobdiff - authd/reslib.c
Normalize snprintf size to use sizeof where possible
[solanum.git] / authd / reslib.c
index 963679dbe8762480b958b80b666ebd447baf5fc3..d66da64f8527b2ed8f1079505b1802a1a528d561 100644 (file)
  * - Dianora
  */
 
-#ifndef _WIN32
+#include <rb_lib.h>
 #include <netdb.h>
-#else
-#include "getaddrinfo.h"
-#include "getnameinfo.h"
-#define getaddrinfo rb_getaddrinfo
-#define getnameinfo rb_getnameinfo
-#define freeaddrinfo rb_freeaddrinfo
-
-extern const char * get_windows_nameservers(void);
-#endif
-
 #include "stdinc.h"
 #include "ircd_defs.h"
-#include "common.h"
 #include "ircd.h"
 #include "res.h"
 #include "reslib.h"
@@ -124,10 +113,10 @@ static const char digitvalue[256] = {
   -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /*256*/
 };
 
+static const char digits[] = "0123456789";
+
 static int parse_resvconf(void);
 static void add_nameserver(const char *);
-
-static const char digits[] = "0123456789";
 static int labellen(const unsigned char *lp);
 static int special(int ch);
 static int printable(int ch);
@@ -172,9 +161,6 @@ parse_resvconf(void)
   char input[DNS_MAXLINE];
   FILE *file;
 
-  /* XXX "/etc/resolv.conf" should be from a define in setup.h perhaps
-   * for cygwin support etc. this hardcodes it to unix for now -db
-   */
   if ((file = fopen("/etc/resolv.conf", "r")) == NULL)
     return -1;
 
@@ -213,9 +199,9 @@ parse_resvconf(void)
     if ((p = strpbrk(arg, " \t")) != NULL)
       *p = '\0';  /* take the first word */
 
-    if (strcasecmp(opt, "domain") == 0)
+    if (rb_strcasecmp(opt, "domain") == 0)
       rb_strlcpy(irc_domain, arg, sizeof(irc_domain));
-    else if (strcasecmp(opt, "nameserver") == 0)
+    else if (rb_strcasecmp(opt, "nameserver") == 0)
       add_nameserver(arg);
   }