X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/fd8184e3bed43669b09f463ae610eff772e9ab65..2685d6e0ddeef51a5aafe6544e3aa6c1dfc5035e:/test/src/fakens.c diff --git a/test/src/fakens.c b/test/src/fakens.c index 00f1f7d46..e4584c4df 100644 --- a/test/src/fakens.c +++ b/test/src/fakens.c @@ -80,6 +80,9 @@ a number of seconds (followed by one space). #include #include #include +#ifdef HAVE_SYS_SOCKET_H +#include +#endif #define FALSE 0 #define TRUE 1 @@ -99,6 +102,7 @@ typedef unsigned char uschar; #define Ustrlen(s) (int)strlen(CCS(s)) #define Ustrncmp(s,t,n) strncmp(CCS(s),CCS(t),n) #define Ustrncpy(s,t,n) strncpy(CS(s),CCS(t),n) +#define Ustrtok(s,t) (uschar*)strtok(CS(s),CCS(t)) typedef struct zoneitem { uschar *zone; @@ -486,13 +490,13 @@ while (fgets(CS buffer, sizeof(buffer), f) != NULL) switch (tvalue) { case ns_t_soa: - p = strtok(p, " "); - ep = p + strlen(p); + p = Ustrtok(p, " "); + ep = p + Ustrlen(p); if (ep[-1] != '.') sprintf(CS ep, "%s.", zone); pk = packname(p, pk); /* primary ns */ - p = strtok(NULL, " "); + p = Ustrtok(NULL, " "); pk = packname(p , pk); /* responsible mailbox */ - *(p += strlen(p)) = ' '; + *(p += Ustrlen(p)) = ' '; while (isspace(*p)) p++; pk = longfield(&p, pk); /* serial */ pk = longfield(&p, pk); /* refresh */ @@ -502,12 +506,12 @@ while (fgets(CS buffer, sizeof(buffer), f) != NULL) break; case ns_t_a: - inet_pton(AF_INET, p, pk); /* FIXME: error checking */ + inet_pton(AF_INET, CCS p, pk); /* FIXME: error checking */ pk += 4; break; case ns_t_aaaa: - inet_pton(AF_INET6, p, pk); /* FIXME: error checking */ + inet_pton(AF_INET6, CCS p, pk); /* FIXME: error checking */ pk += 16; break;