From d0d744d520b993b3167adb2ebe2418ff6bbb4340 Mon Sep 17 00:00:00 2001
From: yhirose <yuji.hirose.bug@gmail.com>
Date: Thu, 20 Feb 2020 17:30:04 -0500
Subject: [PATCH] Fixed compiler warning with Visual C++. Close #358

---
 httplib.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/httplib.h b/httplib.h
index a554b86..da88287 100644
--- a/httplib.h
+++ b/httplib.h
@@ -1545,7 +1545,8 @@ inline std::string get_remote_addr(socket_t sock) {
     std::array<char, NI_MAXHOST> ipstr{};
 
     if (!getnameinfo(reinterpret_cast<struct sockaddr *>(&addr), len,
-                     ipstr.data(), ipstr.size(), nullptr, 0, NI_NUMERICHOST)) {
+                     ipstr.data(), static_cast<socklen_t>(ipstr.size()),
+                     nullptr, 0, NI_NUMERICHOST)) {
       return ipstr.data();
     }
   }