Author: akhaldi Date: Tue Nov 3 22:03:02 2015 New Revision: 69807
URL: http://svn.reactos.org/svn/reactos?rev=69807&view=rev Log: [WS2_32_NEW] Properly handle szLocalName. Properly set Hostent on failure. By Peter Hater. CORE-10440
Modified: trunk/reactos/dll/win32/ws2_32_new/src/getxbyxx.c
Modified: trunk/reactos/dll/win32/ws2_32_new/src/getxbyxx.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ws2_32_new/src/ge... ============================================================================== --- trunk/reactos/dll/win32/ws2_32_new/src/getxbyxx.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ws2_32_new/src/getxbyxx.c [iso-8859-1] Tue Nov 3 22:03:02 2015 @@ -220,7 +220,7 @@ INT ErrorCode; CHAR ResultsBuffer[RNR_BUFFER_SIZE]; PCHAR Results = ResultsBuffer; - CHAR szLocalName[200]; + CHAR szLocalName[MAX_HOSTNAME_LEN]; PCHAR pszName; PWSPROCESS Process; PWSTHREAD Thread; @@ -238,7 +238,7 @@ if(!name || !*name) { /* This means we should do a local lookup first */ - if(gethostname(szLocalName, 200) != NO_ERROR) return(NULL); + if(gethostname(szLocalName, MAX_HOSTNAME_LEN) != NO_ERROR) return(NULL); pszName = szLocalName; } else @@ -277,7 +277,7 @@ else { /* We failed, so zero it out */ - Hostent = 0; + Hostent = NULL;
/* Normalize the error message */ if(GetLastError() == WSASERVICE_NOT_FOUND)