]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: fix osdcaps parsing negative return value
authorSage Weil <sage@newdream.net>
Mon, 13 Sep 2010 03:26:57 +0000 (20:26 -0700)
committerSage Weil <sage@newdream.net>
Mon, 13 Sep 2010 03:26:57 +0000 (20:26 -0700)
src/osd/OSDCaps.cc

index 5e219d9aabdbeee7577077a0cdbebeb079763c17..6a6a61901925b07e4c87eb5fe0990f54e03b6b43 100644 (file)
@@ -40,16 +40,16 @@ bool OSDCaps::get_next_token(string s, size_t& pos, string& token)
   int start = s.find_first_not_of(" \t", pos);
   int end;
 
+  if (start < 0) {
+    return false; 
+  }
+
   if (s[start] == '=' || s[start] == ',' || s[start] == ';') {
     end = start + 1;
   } else {
     end = s.find_first_of(";,= \t", start+1);
   }
 
-  if (start < 0) {
-    return false; 
-  }
-
   if (end < 0) {
     end=s.size();
   }