diff options
author | Rob Savoye <rob.savoye@linaro.org> | 2014-07-11 18:41:08 -0600 |
---|---|---|
committer | Rob Savoye <rob.savoye@linaro.org> | 2014-07-11 18:41:08 -0600 |
commit | b0e4bc003ed2d69d6d95168a3813c40f3937dd82 (patch) | |
tree | 079df4b132bb6dfafcd7f9b629d2210b9375b7aa | |
parent | 078feef6f401610d9457250dcbe6f89efcff94d0 (diff) |
-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; |