mirror of
https://github.com/ceph/ceph
synced 2025-04-01 00:26:47 +00:00
osd: fix osdcaps parsing negative return value
This commit is contained in:
parent
c8da246a3a
commit
3695de1e6e
@ -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();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user