Binary search fix.

git-svn-id: https://protobuf-c.googlecode.com/svn/trunk@203 00440858-1255-0410-a3e6-75ea37f81c3a
This commit is contained in:
lahiker42 2010-02-10 00:30:52 +00:00
parent 69bf014a41
commit c255a6fa0b

View File

@ -1891,7 +1891,7 @@ protobuf_c_enum_descriptor_get_value_by_name
return desc->values + desc->values_by_name[mid].index;
else if (rv < 0)
{
count = start + count - (mid - 1);
count = start + count - (mid + 1);
start = mid + 1;
}
else
@ -1974,7 +1974,7 @@ protobuf_c_service_descriptor_get_method_by_name
return desc->methods + desc->method_indices_by_name[mid];
if (rv < 0)
{
count = start + count - (mid - 1);
count = start + count - (mid + 1);
start = mid + 1;
}
else