diff --git a/source/mod_installer.h b/source/mod_installer.h index 26eb4ef..d1b50ae 100644 --- a/source/mod_installer.h +++ b/source/mod_installer.h @@ -8,6 +8,7 @@ #include #define ZSTD_STATIC_LINKING_ONLY #include +#include #include "utils.h" #include "arcReader.h" #include @@ -91,7 +92,7 @@ bool compressFile(const char* path, u64 compSize, u64 &dataSize, char* outBuff, do { ZSTD_CCtx_setParameter(compContext, ZSTD_c_compressionLevel, compLvl++); dataSize = ZSTD_compress2(compContext, outBuff, bufSize, inBuff, inSize); - if(ZSTD_isError(dataSize) && dataSize != 0xffffffffffffffba) + if(ZSTD_isError(dataSize) && ZSTD_getErrorCode(dataSize) != ZSTD_error_dstSize_tooSmall) log("%s Error at lvl %d: %lx %s\n", path, compLvl, dataSize, ZSTD_getErrorName(dataSize)); if(!ZSTD_isError(dataSize) && dataSize > compSize) { debug_log("Compressed \"%s\" to %lu bytes, %lu bytes away from goal, at level %d.\n", path, dataSize, dataSize - compSize, compLvl-1);