aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Savoye <rob.savoye@linaro.org>2014-07-11 18:41:08 -0600
committerRob Savoye <rob.savoye@linaro.org>2014-07-11 18:41:08 -0600
commitb0e4bc003ed2d69d6d95168a3813c40f3937dd82 (patch)
tree079df4b132bb6dfafcd7f9b629d2210b9375b7aa
parent078feef6f401610d9457250dcbe6f89efcff94d0 (diff)
workaround a problem found on toolchain64HEADmaster
-rw-r--r--monitor.cc5
1 files changed, 4 insertions, 1 deletions
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;