summaryrefslogtreecommitdiff
path: root/win
diff options
context:
space:
mode:
Diffstat (limited to 'win')
-rw-r--r--win/inspircd_win32wrapper.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/win/inspircd_win32wrapper.cpp b/win/inspircd_win32wrapper.cpp
index 6bea73640..d2dcd7456 100644
--- a/win/inspircd_win32wrapper.cpp
+++ b/win/inspircd_win32wrapper.cpp
@@ -65,6 +65,13 @@ int inet_pton(int af, const char *src, void *dst)
sockaddr_in sa;
int len = sizeof(SOCKADDR);
int rv = WSAStringToAddress((LPSTR)src, af, NULL, (LPSOCKADDR)&sa, &len);
+ if(rv >= 0)
+ {
+ if(WSAGetLastError() == 10022) // Invalid Argument
+ rv = 0;
+ else
+ rv = 1;
+ }
memcpy(dst, &sa.sin_addr, sizeof(struct in_addr));
return rv;
}