Browse Source

fix segmentation fault

pull/1/head
Denis Ryabov 4 years ago
parent
commit
4d5f88e301
  1. 2
      db.h
  2. 1
      main.cpp

2
db.h

@ -232,7 +232,7 @@ public:
stats.nTracked = ourId.size(); stats.nTracked = ourId.size();
stats.nGood = goodId.size(); stats.nGood = goodId.size();
stats.nNew = unkId.size(); stats.nNew = unkId.size();
stats.nAge = time(NULL) - idToInfo[ourId[0]].ourLastTry; stats.nAge = ourId.size() > 0 ? time(NULL) - idToInfo[ourId[0]].ourLastTry : 0;
} }
} }

1
main.cpp

@ -341,6 +341,7 @@ vector<CDnsThread*> dnsThread;
extern "C" void* ThreadDNS(void* arg) { extern "C" void* ThreadDNS(void* arg) {
CDnsThread *thread = (CDnsThread*)arg; CDnsThread *thread = (CDnsThread*)arg;
thread->run(); thread->run();
return NULL;
} }
int StatCompare(const CAddrReport& a, const CAddrReport& b) { int StatCompare(const CAddrReport& a, const CAddrReport& b) {

Loading…
Cancel
Save