1
0
mirror of https://github.com/facebook/zstd.git synced 2025-09-02 15:41:31 +03:00

Fix displayLevel overflow

This commit is contained in:
Dmitriy Titarenko
2017-08-23 15:56:15 +05:00
parent bd9c8ca146
commit 20f715d709

View File

@@ -969,7 +969,7 @@ ZDICTLIB_API size_t ZDICT_optimizeTrainFromBuffer_cover(
/* Initialization */
COVER_best_init(&best);
/* Turn down global display level to clean up display at level 2 and below */
g_displayLevel = parameters->zParams.notificationLevel - 1;
g_displayLevel = displayLevel == 0 ? 0 : displayLevel - 1;
/* Loop through d first because each new value needs a new context */
LOCALDISPLAYLEVEL(displayLevel, 2, "Trying %u different sets of parameters\n",
kIterations);