소스 검색

Fixed compiler warning with Visual C++. Close #358

yhirose 6 년 전
부모
커밋
d0d744d520
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      httplib.h

+ 2 - 1
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();
     }
   }