* Fixed BMessageBody::GetInfo(): Indexed based iteration was broken for
two different reasons. * Fixed BMessageBody::FindData() in case of type B_ANY_TYPE, which should match any matchingly-named field. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10678 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -84,13 +84,13 @@ status_t BMessageBody::GetInfo(type_code typeRequested, int32 which,
|
||||
int32 index = 0;
|
||||
for (index = 0; i != fData.end(); ++i)
|
||||
{
|
||||
if (B_ANY_TYPE == typeRequested && i->second->Type() == typeRequested)
|
||||
if (B_ANY_TYPE == typeRequested || i->second->Type() == typeRequested)
|
||||
{
|
||||
++index;
|
||||
if (index == which)
|
||||
{
|
||||
break;
|
||||
}
|
||||
++index;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -402,7 +402,7 @@ BMessageField* BMessageBody::FindData(const char* name, type_code type,
|
||||
else
|
||||
{
|
||||
Item = i->second;
|
||||
if (Item->Type() != type)
|
||||
if (type != B_ANY_TYPE && Item->Type() != type)
|
||||
{
|
||||
err = B_BAD_TYPE;
|
||||
Item = NULL;
|
||||
|
||||
Reference in New Issue
Block a user