Hans Leidekker hans@it.vu.nl writes:
- if (stringW)
- {
ret = WSAAddressToStringW( sockaddr, len, NULL, stringW, &lenstrW );
*lenstr = lenstrW / sizeof(WCHAR);
To be really correct you have to use WideCharToMultiByte to compute the ASCII length. Though in this case it would probably be easier to just duplicate the code and do a simple sprintf in the A function instead of trying to call the W function.