Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor refactoring #47

Merged
merged 1 commit into from
Aug 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions generic/pages.c
Original file line number Diff line number Diff line change
Expand Up @@ -1366,15 +1366,10 @@ static Tcl_WideInt Cookfs_PageSearchStamp(Cookfs_Pages *p) {
// Do not look for the last 20 bytes, as a situation may arise where
// the stamp byte is at the very end of the buffer and the WideInt
// that should come after the stamp is not read.
int bytesToLookup = bufSize - 20;
i = CookfsSearchString(buf, bufSize - 20, p->fileStamp,
COOKFS_SIGNATURE_LENGTH, 1);

for (i = 0; i < bytesToLookup; i++) {
if (buf[i] != p->fileStamp[0]) {
continue;
}
if (memcmp(&buf[i], p->fileStamp, COOKFS_SIGNATURE_LENGTH) != 0) {
continue;
}
if (i > 0) {
goto found;
}

Expand Down