make ZSTD_DECOMPRESSBOUND() compatible with input size 0

for environments with stringent compilation warnings.
This commit is contained in:
Yann Collet
2022-12-16 16:05:39 -08:00
parent ea24b88667
commit 2f4238e47a
2 changed files with 3 additions and 5 deletions
+2 -4
View File
@@ -494,10 +494,8 @@ static void test_decompressBound(int tnb)
char cBuffer[ZSTD_COMPRESSBOUND(sizeof(example))];
size_t const cSize = ZSTD_compress(cBuffer, sizeof(cBuffer), example, sizeof(example), 0);
CHECK_Z(cSize);
{ size_t const dbSize = ZSTD_decompressBound(cBuffer, cSize);
CHECK_Z(dbSize);
CHECK_EQ(dbSize, sizeof(example));
} }
CHECK_EQ(ZSTD_decompressBound(cBuffer, cSize), (unsigned long long)sizeof(example));
}
// Simple small compression without size : should provide 1 block size
{ char cBuffer[ZSTD_COMPRESSBOUND(0)];