From b0e4bc003ed2d69d6d95168a3813c40f3937dd82 Mon Sep 17 00:00:00 2001 From: Rob Savoye Date: Fri, 11 Jul 2014 18:41:08 -0600 Subject: workaround a problem found on toolchain64 --- monitor.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/monitor.cc b/monitor.cc index 4a95293..524b9ae 100644 --- a/monitor.cc +++ b/monitor.cc @@ -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; -- cgit v1.2.3