summaryrefslogtreecommitdiffstats
path: root/src/client/net/serverdiscovery.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/net/serverdiscovery.cpp')
-rw-r--r--src/client/net/serverdiscovery.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/client/net/serverdiscovery.cpp b/src/client/net/serverdiscovery.cpp
index 99a0dcd..5ca0eba 100644
--- a/src/client/net/serverdiscovery.cpp
+++ b/src/client/net/serverdiscovery.cpp
@@ -21,7 +21,7 @@ ServerDiscovery::ServerDiscovery(QObject *parent)
/* Try to get a UDP port for server discovery */
int tries = 10;
while (tries-- != 0) {
- const quint16 port = (quint16)(qrand() % 10000) + 10000;
+ const quint16 port = (quint16)(qrand() % 10000 + 10000);
if (_discoverySocket.bind(QHostAddress::Any, port))
break;
if (tries == 0)
@@ -98,8 +98,8 @@ void ServerDiscovery::doDiscovery()
if (_salt2.size() < SALT_LEN)
_salt2.resize(SALT_LEN);
for (int i = 0; i < SALT_LEN; ++i) {
- salt1[i] = qrand() & 0xff;
- _salt2[i] = qrand() & 0xff;
+ salt1[i] = (char)(qrand() & 0xff);
+ _salt2[i] = (char)(qrand() & 0xff);
}
_packet.reset();
_packet.setField(_HASH, genSha1(&_nameBytes, &salt1, &iplist));