diff --git a/src/read.c b/src/read.c index 6a7124e..752ed52 100644 --- a/src/read.c +++ b/src/read.c @@ -297,7 +297,7 @@ AARU_EXPORT int32_t AARU_CALL aaruf_read_sector(void *context, const uint64_t se return AARUF_ERROR_NOT_AARUFORMAT; } - if(negative && sector_address > ctx->user_data_ddt_header.negative - 1) + if(negative && sector_address > ctx->user_data_ddt_header.negative) { FATAL("Sector address out of bounds"); @@ -868,7 +868,7 @@ AARU_EXPORT int32_t AARU_CALL aaruf_read_sector_long(void *context, const uint64 return AARUF_ERROR_NOT_AARUFORMAT; } - if(negative && sector_address > ctx->user_data_ddt_header.negative - 1) + if(negative && sector_address > ctx->user_data_ddt_header.negative) { FATAL("Sector address out of bounds"); @@ -1509,7 +1509,7 @@ AARU_EXPORT int32_t AARU_CALL aaruf_read_sector_tag(const void *context, const u return AARUF_ERROR_NOT_AARUFORMAT; } - if(negative && sector_address > ctx->user_data_ddt_header.negative - 1) + if(negative && sector_address > ctx->user_data_ddt_header.negative) { FATAL("Sector address out of bounds"); diff --git a/src/write.c b/src/write.c index 0a33efe..477c793 100644 --- a/src/write.c +++ b/src/write.c @@ -130,7 +130,7 @@ AARU_EXPORT int32_t AARU_CALL aaruf_write_sector(void *context, uint64_t sector_ return AARUF_READ_ONLY; } - if(negative && sector_address > ctx->user_data_ddt_header.negative - 1) + if(negative && sector_address > ctx->user_data_ddt_header.negative) { FATAL("Sector address out of bounds"); @@ -569,7 +569,7 @@ AARU_EXPORT int32_t AARU_CALL aaruf_write_sector_long(void *context, uint64_t se return AARUF_READ_ONLY; } - if(negative && sector_address > ctx->user_data_ddt_header.negative - 1) + if(negative && sector_address > ctx->user_data_ddt_header.negative) { FATAL("Sector address out of bounds"); @@ -2101,7 +2101,7 @@ AARU_EXPORT int32_t AARU_CALL aaruf_write_sector_tag(void *context, const uint64 return AARUF_READ_ONLY; } - if(negative && sector_address > ctx->user_data_ddt_header.negative - 1) + if(negative && sector_address > ctx->user_data_ddt_header.negative) { FATAL("Sector address out of bounds");