CGE: Bugfix for scanning archive index in BTFILE class

This commit is contained in:
Paul Gilbert 2011-06-26 18:51:12 +10:00
parent fe9dc10964
commit d5fdd09429
2 changed files with 5 additions and 1 deletions

View File

@ -101,9 +101,10 @@ BT_KEYPACK *BTFILE::Find(const char *key) {
// search
if (pg->Hea.Down != BT_NONE) {
int i;
for (i = 0; i < pg->Hea.Count; i ++)
for (i = 0; i < pg->Hea.Count; i ++) {
if (memicmp(key, pg->Inn[i].Key, BT_KEYLEN) < 0)
break;
}
nxt = (i) ? pg->Inn[i - 1].Down : pg->Hea.Down;
Buff[lev].Indx = i - 1;
++ lev;

View File

@ -39,6 +39,7 @@ namespace CGE {
#define BT_NONE 0xFFFF
#define BT_ROOT 0
#include "common/pack-start.h" // START STRUCT PACKING
struct BT_KEYPACK {
char Key[BT_KEYLEN];
@ -66,6 +67,8 @@ struct BT_PAGE {
};
};
#include "common/pack-end.h" // END STRUCT PACKING
class BTFILE : public IOHAND {
struct {