Skip to content

Commit 9501cce

Browse files
committed
fix: return empty AsciiString instead of nullptr in getMachineName()
1 parent f204b3d commit 9501cce

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Core/GameEngine/Source/GameNetwork/IPEnumeration.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,12 +172,12 @@ AsciiString IPEnumeration::getMachineName( void )
172172

173173
int err = WSAStartup(verReq, &wsadata);
174174
if (err != 0) {
175-
return nullptr;
175+
return AsciiString();
176176
}
177177

178178
if ((LOBYTE(wsadata.wVersion) != 2) || (HIBYTE(wsadata.wVersion) !=2)) {
179179
WSACleanup();
180-
return nullptr;
180+
return AsciiString();
181181
}
182182
m_isWinsockInitialized = true;
183183
}
@@ -187,7 +187,7 @@ AsciiString IPEnumeration::getMachineName( void )
187187
if (gethostname(hostname, sizeof(hostname)))
188188
{
189189
DEBUG_LOG(("Failed call to gethostname; WSAGetLastError returned %d", WSAGetLastError()));
190-
return nullptr;
190+
return AsciiString();
191191
}
192192

193193
return AsciiString(hostname);

0 commit comments

Comments
 (0)