Merge pull request #814 from dscheg/dev

Fix displayLevel overflow
This commit is contained in:
Yann Collet 2017-08-23 11:30:45 -07:00 committed by GitHub
commit f7a09dd679

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);