Fix potential uninitialized variable bug in BLayout::AllUnarchived().

BMessage::GetInfo() doesn't set the count output var in error cases.
This commit is contained in:
Alex Wilson 2011-12-28 22:50:25 -07:00
parent 9f0292314d
commit 981c729bdc

View File

@ -468,7 +468,7 @@ BLayout::AllUnarchived(const BMessage* from)
if (err != B_OK)
return err;
int32 itemCount;
int32 itemCount = 0;
unarchiver.ArchiveMessage()->GetInfo(kLayoutItemField, NULL, &itemCount);
for (int32 i = 0; i < itemCount && err == B_OK; i++) {
BLayoutItem* item;