Fix puffs_base__writer1__copy_from_history32.

This commit is contained in:
Nigel Tao committed 2017-11-09 13:35:45 +11:00
1 parent c69e256b0c
commit 82e5734778
4 files changed
+11 -14

No files matched your search

+2 -3
View File
@@ -522,12 +522,11 @@ static inline uint32_t puffs_base__writer1__copy_from_history32(
uint8_t* end,
uint32_t distance,
uint32_t length) {
if (!start) {
if (!start || !distance) {
return 0;
}
uint8_t* ptr = *ptr_ptr;
size_t d = ptr - start;
if ((d == 0) || (d < (size_t)(distance))) {
if ((size_t)(ptr - start) < (size_t)(distance)) {
return 0;
}
start = ptr - distance;
+2 -3
View File
@@ -464,12 +464,11 @@ static inline uint32_t puffs_base__writer1__copy_from_history32(
uint8_t* end,
uint32_t distance,
uint32_t length) {
if (!start) {
if (!start || !distance) {
return 0;
}
uint8_t* ptr = *ptr_ptr;
size_t d = ptr - start;
if ((d == 0) || (d < (size_t)(distance))) {
if ((size_t)(ptr - start) < (size_t)(distance)) {
return 0;
}
start = ptr - distance;