Commit 42a9ca57 authored by Paul Rupe's avatar Paul Rupe Committed by Alexandre Julliard

Treat blank protocol the same as NULL in getservbyname &

getservbyport.
parent a9c51cb6
......@@ -3158,7 +3158,7 @@ static WIN_servent* __ws_getservbyname(const char *name, const char *proto, int
if( i ) {
EnterCriticalSection( &csWSgetXXXbyYYY );
serv = getservbyname(local_buffer,
proto ? (local_buffer + i) : NULL);
proto && *proto ? (local_buffer + i) : NULL);
if( serv != NULL )
{
if( WS_dup_se(serv, dup_flag) )
......@@ -3207,7 +3207,8 @@ static WIN_servent* __ws_getservbyport(int port, const char* proto, int dup_flag
struct servent* serv;
if (!proto || wsi_strtolo( proto, NULL )) {
EnterCriticalSection( &csWSgetXXXbyYYY );
if( (serv = getservbyport(port, (proto) ? local_buffer : NULL)) != NULL ) {
if( (serv = getservbyport(port, proto && *proto ? local_buffer :
NULL)) != NULL ) {
if( WS_dup_se(serv, dup_flag) )
retval = se_buffer;
else SetLastError(WSAENOBUFS);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment