correct reference to new hostname for Qt temp variable changes

This commit is contained in:
Stephen Birarda 2013-07-18 15:20:05 -07:00
parent 4dd6afc08f
commit 45d82dc97c
2 changed files with 5 additions and 4 deletions

View file

@ -1143,10 +1143,11 @@ void Application::editPreferences() {
return;
}
const char* newHostname = domainServerHostname->text().toStdString().c_str();
char newHostname[MAX_HOSTNAME_BYTES] = {};
memcpy(newHostname, domainServerHostname->text().toAscii().data(), domainServerHostname->text().size());
// check if the domain server hostname is new
if (memcmp(NodeList::getInstance()->getDomainHostname(), newHostname, sizeof(&newHostname)) != 0) {
if (memcmp(NodeList::getInstance()->getDomainHostname(), newHostname, strlen(newHostname)) != 0) {
// if so we need to clear the nodelist and delete the existing voxel and environment data
Node *voxelServer = NodeList::getInstance()->soloNodeOfType(NODE_TYPE_VOXEL_SERVER);

View file

@ -32,7 +32,7 @@ const int DOMAIN_SERVER_CHECK_IN_USECS = 1 * 1000000;
extern const char SOLO_NODE_TYPES[3];
const int MAX_HOSTNAME_BYTES = 255;
const int MAX_HOSTNAME_BYTES = 256;
extern const char DEFAULT_DOMAIN_HOSTNAME[MAX_HOSTNAME_BYTES];
extern const char DEFAULT_DOMAIN_IP[INET_ADDRSTRLEN]; // IP Address will be re-set by lookup on startup