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

Correct HACK logic for Stat/Transfer #318

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
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
7 changes: 3 additions & 4 deletions src/sas/readstat_sas7bdat_read.c
Original file line number Diff line number Diff line change
Expand Up @@ -979,12 +979,11 @@
if ((page_type & SAS_PAGE_TYPE_MASK) == SAS_PAGE_TYPE_MIX) {
/* HACK - this is supposed to obey 8-byte boundaries but
* some files created by Stat/Transfer don't. So verify that the
* padding is { 0, 0, 0, 0 } or { ' ', ' ', ' ', ' ' } (or that
* padding is { 0, 0, 0, 0 } or { ' ', ' ', ' ', ' ' } (and that
* the file is not from Stat/Transfer) before skipping it */
if ((shp-page)%8 == 4 && shp + 4 <= page + page_size &&
(*(uint32_t *)shp == 0x00000000 ||
*(uint32_t *)shp == 0x20202020 ||
ctx->vendor != READSTAT_VENDOR_STAT_TRANSFER)) {
(*(uint32_t *)shp == 0x00000000 || *(uint32_t *)shp == 0x20202020) &&
ctx->vendor != READSTAT_VENDOR_STAT_TRANSFER) {

Check warning on line 986 in src/sas/readstat_sas7bdat_read.c

View check run for this annotation

Codecov / codecov/patch

src/sas/readstat_sas7bdat_read.c#L985-L986

Added lines #L985 - L986 were not covered by tests
data = shp + 4;
} else {
data = shp;
Expand Down
Loading