[PATCH] ws2_32: Improved error handling in gethostname when name length is insufficient. (try 2)

Qian Hong qhong at codeweavers.com
Wed Mar 11 12:08:09 CDT 2015


Windows supports NetBIOS name length max to 15, don't fail silently for 
Windows application with insufficient name length.

Try 2:
- Use sizeof instead of number for buffer length.
- Improve debugging message.
- Corrected a corner case of an if condition: change from (if namelen < 
len) to (if namelen <= len)
- Better corner case test.

Thanks a lot to Bruno for many helps! :)

---
  dlls/ws2_32/socket.c     | 31 +++++++++++++++++++++++++------
  dlls/ws2_32/tests/sock.c | 34 ++++++++++++++++++++++++++++++++++
  2 files changed, 59 insertions(+), 6 deletions(-)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-ws2_32-Improved-error-handling-in-gethostname-when-nam.txt
Type: text/x-patch
Size: 3030 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-patches/attachments/20150312/ce2d38f6/attachment.bin>


More information about the wine-patches mailing list