I have a SAS file that interacts poorly with the following
if ((shp-page)%8 == 4 && shp + 4 <= page + page_size &&
(*(uint32_t *)shp == 0x00000000 ||
*(uint32_t *)shp == 0x20202020 ||
ctx->vendor != READSTAT_VENDOR_STAT_TRANSFER)) {
data = shp + 4;
} else {
data = shp;
}
https://github.com/stone-statai/ReadStat/blob/3c68974fbb35c5bf0888fd603cd99b8253477359/src/sas/readstat_sas7bdat_read.c#L1025-L1032
The file is from Stat/Transfer and it happens to have what looks like padding bytes, however they are not. This causes the 4 bytes to be skipped on this page, and my data is truncated.
I'm not sure if there's a good fix. One option maybe to pass a flag to set this behavior.
I have a SAS file that interacts poorly with the following
https://github.com/stone-statai/ReadStat/blob/3c68974fbb35c5bf0888fd603cd99b8253477359/src/sas/readstat_sas7bdat_read.c#L1025-L1032
The file is from Stat/Transfer and it happens to have what looks like padding bytes, however they are not. This causes the 4 bytes to be skipped on this page, and my data is truncated.
I'm not sure if there's a good fix. One option maybe to pass a flag to set this behavior.