Fix coverity CID 102345
[novacoin.git] / src / irc.cpp
index b594529..bc1cb31 100644 (file)
@@ -20,7 +20,7 @@ void ThreadIRCSeed2(void* parg);
 struct ircaddr
 {
     struct in_addr ip;
-    unsigned short port;
+    uint16_t port;
 };
 #pragma pack(pop)
 
@@ -260,7 +260,7 @@ void ThreadIRCSeed2(void* parg)
         // or if it keeps failing because the nick is already in use.
         if (!fNoListen && GetLocal(addrLocal, &addrIPv4) && nNameRetry<3)
             strMyName = EncodeAddress(GetLocalAddress(&addrConnect));
-        if (strMyName == "")
+        if (strMyName.empty())
             strMyName = strprintf("x%" PRIu64 "", GetRand(1000000000));
 
         Send(hSocket, strprintf("NICK %s\r", strMyName.c_str()).c_str());
@@ -274,8 +274,10 @@ void ThreadIRCSeed2(void* parg)
             {
                 printf("IRC name already in use\n");
                 nNameRetry++;
-                Wait(10);
-                continue;
+                if (Wait(10))
+                    continue;
+                else
+                    return;
             }
             nErrorWait = nErrorWait * 11 / 10;
             if (Wait(nErrorWait += 60))