From: Yan Jun Date: Wed, 22 Jun 2016 16:00:27 +0000 (+0800) Subject: common/config: fix return type of string::find and use string::npos X-Git-Tag: v12.0.0~169^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=00e067e79d0794fa0357db3909e6718ac8bb2435;p=ceph.git common/config: fix return type of string::find and use string::npos Signed-off-by: Yan Jun --- diff --git a/src/common/entity_name.cc b/src/common/entity_name.cc index 2e0b0cb1d9ef..4ea68cfa6765 100644 --- a/src/common/entity_name.cc +++ b/src/common/entity_name.cc @@ -57,9 +57,9 @@ to_cstr() const bool EntityName:: from_str(const string& s) { - int pos = s.find('.'); + size_t pos = s.find('.'); - if (pos < 0) + if (pos == string::npos) return false; string type_ = s.substr(0, pos);