check also read ip from file if valid
This commit is contained in:
parent
a3c8fe44dd
commit
1756b0cf5e
@ -4,6 +4,7 @@
|
||||
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <climits>
|
||||
|
||||
#include "FileLogger.h"
|
||||
|
||||
@ -24,5 +25,9 @@ std::string FileLogger::readip() {
|
||||
|
||||
in >> ip;
|
||||
|
||||
// when received ip has no : return 0.0.0.0
|
||||
if (ip.find(':') == ULONG_MAX)
|
||||
return "0.0.0.0";
|
||||
else
|
||||
return ip;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user