x == '#' || x == '\n' || x == '\r' || x == ';' || x == '\0' \
)
+/* Work-around for not having strnlen
+*/
+#if !HAVE_STRNLEN
+ #define strnlen(s, l) (strlen(s) < l ? strlen(s) : l)
+#endif
+
#endif /* _COMMON_H */
/***EOF***/
#endif
#ifdef WIN32
+ #include <io.h>
+ #define strcasecmp _stricmp
+ #define strncasecmp _strnicmp
+ #define snprintf _snprintf
+ #define strdup _strdup
+ #define unlink _unlink
+ #define open _open
+ #define close _close
+ #define write _write
+ #define O_WRONLY _O_WRONLY
+ #define O_RDONLY _O_RDONLY
+ #define O_RDWR _O_RDWR
+ #define O_CREAT _O_CREAT
+ #define O_EXCL _O_EXCL
+ #define S_IRUSR _S_IREAD
+ #define S_IWUSR _S_IWRITE
+ #define PATH_SEP '\\'
+
/* These are needed for the digest code under windows.
*/
typedef unsigned __int8 uint8_t;
typedef unsigned __int32 uint32_t;
typedef unsigned __int64 uint64_t;
-
- #define strdup _strdup
#else
#if HAVE_STDINT_H
#include <stdint.h>
/* Try to cover for those that do not have bzero.
*/
#if !HAVE_BZERO && HAVE_MEMSET
-# define bzero(buf, bytes) ((void) memset (buf, 0, bytes))
+ #define bzero(buf, bytes) ((void) memset (buf, 0, bytes))
+#endif
+
+/* Work-around for not having strnlen
+*/
+#if !HAVE_STRNLEN
+ #define strnlen(s, l) (strlen(s) < l ? strlen(s) : l)
#endif
#endif /* FKO_COMMON_H */
#include "fko_message.h"
#include "fko.h"
-/* for inet_aton() IP validation
-*/
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
+#ifndef WIN32
+ /* for inet_aton() IP validation
+ */
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+ #include <arpa/inet.h>
+#endif
static int
have_allow_ip(const char *msg)
/* Define to 1 if you have the `strndup' function. */\r
#define HAVE_STRNDUP 1\r
\r
+/* Define to 1 if you have the `strnlen' function. */\r
+#define HAVE_STRNLEN 1\r
+ \r
/* Define to 1 if you have the `strrchr' function. */\r
#define HAVE_STRRCHR 1\r
\r