Re: ws2_32: Fix some edge cases for getaddrinfo in BSD and OSX
Bruno Jesus <00cpxxx(a)gmail.com> wrote:
+ /* servname tweaks required by OSX and BSD kernels */ + if (!servname) + serv = NULL; + else if (!servname[0]) + serv = "0"; + else + serv = servname;
Shouldn't 'serv = "0"' be 'serv = ""' ? -- Dmitry.
On Fri, Feb 14, 2014 at 9:27 AM, Dmitry Timoshkov <dmitry(a)baikal.ru> wrote:
Bruno Jesus <00cpxxx(a)gmail.com> wrote:
+ /* servname tweaks required by OSX and BSD kernels */ + if (!servname) + serv = NULL; + else if (!servname[0]) + serv = "0"; + else + serv = servname;
Shouldn't 'serv = "0"' be 'serv = ""' ?
No, that is the trick. Linux supports both "" and "0" but OSX/BSD does not support "". So turning the "" into "0" solves the issue.
-- Dmitry.
Bruno
participants (2)
-
Bruno Jesus -
Dmitry Timoshkov