Added extra check in mbfile check

This commit is contained in:
Michiel Broek
2004-05-02 12:19:52 +00:00
parent 2b0a088da4
commit 0e574d5a8d
2 changed files with 15 additions and 1 deletions

View File

@@ -190,7 +190,19 @@ void Check(void)
fwrite(&fdbhdr, sizeof(fdbhdr), 1, pFile);
} else {
fread(&fdbhdr, sizeof(fdbhdr), 1, pFile);
}
}
/*
* We don't do any upgrade, so the header must be correct.
*/
if (fdbhdr.hdrsize != sizeof(fdbhdr)) {
Syslog('+', "fAreas hdrsize is corrupt: %d", fdbhdr.hdrsize);
return;
}
if (fdbhdr.recsize != sizeof(fdb)) {
Syslog('+', "fAreas recordsize is corrupt: %d, expected %d", fdbhdr.recsize, sizeof(fdbhdr));
return;
}
/*
* Now start checking the files in the filedatabase