From 92cc2206a1342ea59a8f12a854fb90dcb2d041fe Mon Sep 17 00:00:00 2001 From: Jordan Bancino Date: Wed, 2 Nov 2022 15:20:37 +0000 Subject: [PATCH] Fix a few things to make Telodendria compile and run on Cygwin. --- src/HttpServer.c | 2 ++ src/Util.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/HttpServer.c b/src/HttpServer.c index 908627a..df9afb6 100644 --- a/src/HttpServer.c +++ b/src/HttpServer.c @@ -362,10 +362,12 @@ HttpServerCreate(unsigned short port, unsigned int nThreads, unsigned int maxCon goto error; } +#ifdef SO_REUSEPORT if (setsockopt(server->sd, SOL_SOCKET, SO_REUSEPORT, &ENABLE, sizeof(int)) < 0) { goto error; } +#endif sa.sin_family = AF_INET; sa.sin_port = htons(port); diff --git a/src/Util.c b/src/Util.c index 6bf6b11..d6a0cc3 100644 --- a/src/Util.c +++ b/src/Util.c @@ -135,7 +135,7 @@ UtilStringToBytes(char *str) while (*str) { - if (isdigit(*str)) + if (isdigit((unsigned char) *str)) { bytes *= 10; bytes += *str - '0';