mirror of
https://github.com/glest/glest-source.git
synced 2025-08-17 21:51:17 +02:00
- more NULL checking for safer execution
This commit is contained in:
@@ -1229,9 +1229,9 @@ bool Socket::isConnected() {
|
||||
|
||||
string Socket::getHostName() {
|
||||
const int strSize= 256;
|
||||
char hostname[strSize];
|
||||
char hostname[strSize]="";
|
||||
gethostname(hostname, strSize);
|
||||
return hostname;
|
||||
return (hostname[0] != '\0' ? hostname : "");
|
||||
}
|
||||
|
||||
string Socket::getIp() {
|
||||
|
Reference in New Issue
Block a user