From: Juergen Perlinger Date: Mon, 25 May 2020 10:42:46 +0000 (+0200) Subject: [Bug 3667] decodenetnum fails with numeric port X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c00a0f6d4b6bb7051c3d115afc64327b8d2fd755;p=thirdparty%2Fntp.git [Bug 3667] decodenetnum fails with numeric port - windows compilation issues bk: 5ecba126vqehAvmc7RBAUU2ULCOEFg --- diff --git a/libntp/decodenetnum.c b/libntp/decodenetnum.c index d8a7296e4..8ff676252 100644 --- a/libntp/decodenetnum.c +++ b/libntp/decodenetnum.c @@ -91,7 +91,7 @@ decodenetnum( char buf[64]; /* working copy of input */ char *haddr=buf; unsigned int port=NTP_PORT, scope=0; - sa_family_t afam=AF_UNSPEC; + unsigned short afam=AF_UNSPEC; /* copy input to working buffer with length check */ if (strlcpy(buf, num, sizeof(buf)) >= sizeof(buf)) diff --git a/libntp/strdup.c b/libntp/strdup.c index 5d9d73876..8af9ff81b 100644 --- a/libntp/strdup.c +++ b/libntp/strdup.c @@ -1,8 +1,8 @@ #include #include -#include "ntp_malloc.h" #include +#include "ntp_malloc.h" #include "l_stdlib.h" #define STRDUP_EMPTY_UNIT @@ -32,12 +32,12 @@ strdup( # undef STRDUP_EMPTY_UNIT void *memchr(const void *s, int c, size_t n) { - const unsignec char *p = s; + const unsigned char *p = s; while (n && *p != c) { --n; ++p; } - return n ? p : NULL; + return n ? (char*)p : NULL; } #endif diff --git a/ports/winnt/include/config.h b/ports/winnt/include/config.h index 6f70bd3ce..17526c266 100644 --- a/ports/winnt/include/config.h +++ b/ports/winnt/include/config.h @@ -411,6 +411,8 @@ typedef int ssize_t; /* ssize is an int */ # define HAVE_SETVBUF 1 # define HAVE_STRCHR 1 /* for libopts */ # define HAVE_STRDUP 1 +# define HAVE_STRNLEN 1 +# define HAVE_MEMCHR 1 # define HAVE_TIMEGM 1 /* actually _mkgmtime */ # define HAVE_STRUCT_TIMESPEC