-
Notifications
You must be signed in to change notification settings - Fork 220
Fixed corruption due to Unicode/ANSI API mismatch #6
Conversation
Have to call WSAAddressToStringA (non-Unicode version) manually, otherwise Visual Studio redefines it to call the wide version, causing corruption and a buffer overrun.
Stupid MSVC autoformatting.
I've merged #9 which makes the change from Is You mentioned some other warnings in the comments for #9 -- I should be able to fix the SOCKET casting myself but I'd welcome any commits which fix other warnings on MSVC; I don't have direct access to MSVC myself and can't test things or fix things regarding it easily. Thanks! |
Hmm, in an older build of dyad, The SOCKET casting is because SOCKET in Winsock is an |
In that case I'll close this pull request as it doesn't seem relevant any longer.
I'll probably introduce a Did you get warnings regarding anything else or just the |
I noticed a few size_t -> int warnings as well on x64. |
Ah, I'll have to look into that too. I committed the change I mentioned above, converting the |
@rxi For reference, here are the warnings I get when compiling dyad.c for x64 with MSVC 2015 as of the latest build (warning level
The build I was using before had a few double -> int conversion warnings, so it looks like those were fixed, at least. |
Have to call WSAAddressToStringA (non-Unicode version) manually, otherwise Visual Studio redefines it to call the wide version, causing a buffer overrun and a corrupted address string.