aboutsummaryrefslogtreecommitdiffstats
path: root/lib/sisfile.cpp
diff options
context:
space:
mode:
authorDaniel Brahneborg <basic@chello.se>2002-04-14 12:03:02 +0000
committerDaniel Brahneborg <basic@chello.se>2002-04-14 12:03:02 +0000
commitf1f20db42313032578ba256903d0004dd126a60a (patch)
tree228e3636eaa61d89f35bea8fd782b095758e88ca /lib/sisfile.cpp
parent06e892c7ae2f4d542b6e6aa4549c9585857087b6 (diff)
downloadplptools-f1f20db42313032578ba256903d0004dd126a60a.tar.gz
plptools-f1f20db42313032578ba256903d0004dd126a60a.tar.bz2
plptools-f1f20db42313032578ba256903d0004dd126a60a.zip
More correct residual sis file truncation
Diffstat (limited to 'lib/sisfile.cpp')
-rw-r--r--lib/sisfile.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/sisfile.cpp b/lib/sisfile.cpp
index df60695..97fde1d 100644
--- a/lib/sisfile.cpp
+++ b/lib/sisfile.cpp
@@ -49,6 +49,7 @@ SISFile::compareApp(SISFile* other)
SisRC
SISFile::fillFrom(uint8_t* buf, off_t len)
{
+ m_end = 0;
int ix = 0;
m_buf = buf;
SisRC rc = m_header.fillFrom(buf, &ix, len);
@@ -77,6 +78,7 @@ SISFile::fillFrom(uint8_t* buf, off_t len)
return rc;
}
}
+ updateEnd(ix);
// Read requisites.
//
@@ -94,11 +96,14 @@ SISFile::fillFrom(uint8_t* buf, off_t len)
return rc;
}
}
+ updateEnd(ix);
// Read component names, by language.
//
ix = m_header.m_componentPtr;
- rc = m_componentRecord.fillFrom(buf, ix, len, this);
+ rc = m_componentRecord.fillFrom(buf, &ix, len, this);
+ updateEnd(ix);
+ updateEnd(m_componentRecord.getLastEnd());
if (rc != SIS_OK)
{
printf(_("Problem reading the name record, rc = %d.\n"), rc);
@@ -125,6 +130,7 @@ SISFile::fillFrom(uint8_t* buf, off_t len)
return rc;
}
}
+ updateEnd(ix);
return SIS_OK;
}
@@ -165,3 +171,10 @@ SISFile::setLanguage(int lang)
m_header.m_installationLanguage = lang;
}
+void
+SISFile::updateEnd(uint32_t pos)
+{
+ if (m_end < pos)
+ m_end = pos;
+}
+