- more NULL checking for safer execution

This commit is contained in:
Mark Vejvoda
2010-08-20 22:17:30 +00:00
parent 09f7eecf06
commit 0e82836e01
2 changed files with 3 additions and 3 deletions

View File

@@ -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() {