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: @@ -232,7 +232,7 @@ public:
stats.nTracked = ourId.size();
stats.nGood = goodId.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; @@ -341,6 +341,7 @@ vector<CDnsThread*> dnsThread;
extern "C" void* ThreadDNS(void* arg) {
CDnsThread *thread = (CDnsThread*)arg;
thread->run();
return NULL;
}
int StatCompare(const CAddrReport& a, const CAddrReport& b) {

Loading…
Cancel
Save