Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix proposal for issue Benjamin-Dobell#55

  • Loading branch information...
commit 1e76080b5e03cbe5c2594afd0ecf42c6b5e5b8bc 1 parent 4f32206
@nka11 authored
Showing with 12 additions and 4 deletions.
  1. +12 −4 libpit/Source/libpit.cpp
View
16 libpit/Source/libpit.cpp
@@ -255,7 +255,9 @@ PitEntry *PitData::FindEntry(const char *partitionName)
{
for (unsigned int i = 0; i < entries.size(); i++)
{
- if (entries[i]->GetBlockCount() > 0 && strcmp(entries[i]->GetPartitionName(), partitionName) == 0)
+ if (
+ (entries[i]->GetBlockCount() > 0 || strcmp(entries[i]->GetFotaFilename(), "remaining"))&&
+ strcmp(entries[i]->GetPartitionName(), partitionName) == 0)
return (entries[i]);
}
@@ -266,7 +268,9 @@ const PitEntry *PitData::FindEntry(const char *partitionName) const
{
for (unsigned int i = 0; i < entries.size(); i++)
{
- if (entries[i]->GetBlockCount() > 0 && strcmp(entries[i]->GetPartitionName(), partitionName) == 0)
+ if (
+ (entries[i]->GetBlockCount() > 0 || strcmp(entries[i]->GetFotaFilename(), "remaining")) &&
+ strcmp(entries[i]->GetPartitionName(), partitionName) == 0)
return (entries[i]);
}
@@ -277,7 +281,9 @@ PitEntry *PitData::FindEntry(unsigned int partitionIdentifier)
{
for (unsigned int i = 0; i < entries.size(); i++)
{
- if (entries[i]->GetBlockCount() > 0 && entries[i]->GetIdentifier() == partitionIdentifier)
+ if (
+ (entries[i]->GetBlockCount() > 0 || strcmp(entries[i]->GetFotaFilename(), "remaining")) &&
+ entries[i]->GetIdentifier() == partitionIdentifier)
return (entries[i]);
}
@@ -288,7 +294,9 @@ const PitEntry *PitData::FindEntry(unsigned int partitionIdentifier) const
{
for (unsigned int i = 0; i < entries.size(); i++)
{
- if (entries[i]->GetBlockCount() > 0 && entries[i]->GetIdentifier() == partitionIdentifier)
+ if (
+ (entries[i]->GetBlockCount() > 0 || strcmp(entries[i]->GetFotaFilename(), "remaining")) &&
+ entries[i]->GetIdentifier() == partitionIdentifier)
return (entries[i]);
}
Please sign in to comment.
Something went wrong with that request. Please try again.