diff options
Diffstat (limited to 'monitor.cc')
-rw-r--r-- | monitor.cc | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -288,7 +288,10 @@ parseResults(const char *resultStr) } else { hname = he->h_name; /* Remove domain name from end of hostname. */ - hname.erase(hname.find_first_of('.')); + size_t dot = hname.find_first_of('.'); + if (dot != std::string::npos) { + hname.erase(dot); + } } std::ostringstream hostname; hostname << hname; |