aboutsummaryrefslogtreecommitdiffstats
path: root/lib/siscomponentrecord.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/siscomponentrecord.cpp')
-rw-r--r--lib/siscomponentrecord.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/siscomponentrecord.cpp b/lib/siscomponentrecord.cpp
index b4b313a..ff3153f 100644
--- a/lib/siscomponentrecord.cpp
+++ b/lib/siscomponentrecord.cpp
@@ -13,7 +13,8 @@ SISComponentNameRecord::~SISComponentNameRecord()
void
SISComponentNameRecord::fillFrom(uchar* buf, int base, SISFile* sisFile)
{
- int ix = base;
+ uchar* p = buf + base;
+ int size = 0;
int n = sisFile->m_header.m_nlangs;
m_nameLengths = new uint32[n];
@@ -24,14 +25,16 @@ SISComponentNameRecord::fillFrom(uchar* buf, int base, SISFile* sisFile)
//
for (int i = 0; i < n; ++i)
{
- m_nameLengths[i] = read32(buf, &ix);
+ m_nameLengths[i] = read32(p + size);
+ size += 4;
}
// Then read ptrs.
//
for (int i = 0; i < n; ++i)
{
- m_namePtrs[i] = read32(buf, &ix);
+ m_namePtrs[i] = read32(p + size);
+ size += 4;
if (logLevel >= 2)
printf("Name %d (for %s) is %.*s\n",
i,
@@ -44,7 +47,7 @@ SISComponentNameRecord::fillFrom(uchar* buf, int base, SISFile* sisFile)
m_names[i][len] = 0;
}
if (logLevel >= 1)
- printf("%d .. %d (%d bytes): Name records\n", base, ix, ix - base);
+ printf("%d .. %d (%d bytes): Name records\n", base, base + size, size);
}
uchar*