]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
common/config: fix return type of string::find and use string::npos 9924/head
authorYan Jun <yan.jun8@zte.com.cn>
Wed, 22 Jun 2016 16:00:27 +0000 (00:00 +0800)
committerYan Jun <yan.jun8@zte.com.cn>
Wed, 22 Jun 2016 16:00:27 +0000 (00:00 +0800)
Signed-off-by: Yan Jun <yan.jun8@zte.com.cn>
src/common/entity_name.cc

index 2e0b0cb1d9efee076f78f20728c52a8601a66d64..4ea68cfa67656439c3be775151dab4ca36a45359 100644 (file)
@@ -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);