summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graemeg@gmail.com>2009-10-03 15:13:29 +0200
committerGraeme Geldenhuys <graemeg@gmail.com>2009-10-03 15:13:29 +0200
commit988ad8b45ad1b0afff7f5bef12df8d3c978837eb (patch)
tree03c8b1793a555823c8c99ace68dcb14aeb4c330b /src
parent7e98042fd543d03cccce57cc2e9a7c902f1a35a7 (diff)
downloadfpGUI-988ad8b45ad1b0afff7f5bef12df8d3c978837eb.tar.xz
Finally found the bug that caused Topic text to be garbled.
Signed-off-by: Graeme Geldenhuys <graemeg@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/HelpTopic.pas7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/HelpTopic.pas b/src/HelpTopic.pas
index c0f72ffc..1d64c147 100644
--- a/src/HelpTopic.pas
+++ b/src/HelpTopic.pas
@@ -222,10 +222,11 @@ begin
if SlotNumber < FileHeader.nslots then
begin
pSlotOffsets := FileData + FileHeader.slotsstart;
-
+ // point to correct slot offset
pSlotData := pSlotHeader( FileData + pSlotOffsets^[ SlotNumber ] );
-
- Slot.pData := pInt8( pSlotData + sizeof( TSlotHeader ) );
+ if pSlotData^.stuff <> Byte(0) then
+ raise Exception.Create('We are NOT at the correct location in the file for the SlotHeader structure!');
+ Slot.pData := pInt8(pSlotData) + sizeof(TSlotHeader);
Slot.pLocalDictionary := FileData + pSlotData^.localDictPos;
Slot.LocalDictSize := pSlotData^.nLocalDict;
Slot.Size := pSlotData^.ntext;