From a1797f0d0d54dbe5966fd5751c3439ccee090129 Mon Sep 17 00:00:00 2001 From: Andras Fekete Date: Mon, 13 May 2024 13:45:22 -0400 Subject: [PATCH] Fix casts depending on OS --- examples/client/client.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/client/client.c b/examples/client/client.c index d8486fd98..2a45a9937 100644 --- a/examples/client/client.c +++ b/examples/client/client.c @@ -801,7 +801,7 @@ doExit: if (exitWithRet) return err; -#ifdef __MINGW32__ +#if defined(__MINGW32__) || defined(_WIN32) #define SIZE_FMT "%d" #define SIZE_TYPE int #else @@ -852,7 +852,7 @@ static int StartTLS_Init(SOCKET_T* sockfd) } /* C: EHLO mail.example.com */ - if (send(*sockfd, starttlsCmd[1], XSTRLEN(starttlsCmd[1]), 0) != + if (send(*sockfd, starttlsCmd[1], (SIZE_TYPE)XSTRLEN(starttlsCmd[1]), 0) != (int)XSTRLEN(starttlsCmd[1])) err_sys("failed to send STARTTLS EHLO command\n"); @@ -869,7 +869,7 @@ static int StartTLS_Init(SOCKET_T* sockfd) } /* C: STARTTLS */ - if (send(*sockfd, starttlsCmd[3], XSTRLEN(starttlsCmd[3]), 0) != + if (send(*sockfd, starttlsCmd[3], (SIZE_TYPE)XSTRLEN(starttlsCmd[3]), 0) != (int)XSTRLEN(starttlsCmd[3])) { err_sys("failed to send STARTTLS command\n"); }