From: Yann Collet Date: Fri, 19 Feb 2016 14:16:15 +0000 (+0100) Subject: silence array subscript warning X-Git-Tag: v0.6.0^2~25 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=191b52a8dcc47c33e34d0dbfd7f95953ac1ad9ed;p=thirdparty%2Fzstd.git silence array subscript warning --- diff --git a/lib/huff0.c b/lib/huff0.c index 929bc87b1..d17493729 100644 --- a/lib/huff0.c +++ b/lib/huff0.c @@ -1381,7 +1381,7 @@ size_t HUF_readDTableX6 (U32* DTable, const void* src, size_t srcSize) if (tableLog > memLog) return ERROR(tableLog_tooLarge); /* DTable is too small */ /* find maxWeight */ - for (maxW = tableLog; rankStats[maxW]==0; maxW--) {} /* necessarily finds a solution before 0 */ + for (maxW = tableLog; maxW && rankStats[maxW]==0; maxW--) {} /* necessarily finds a solution before 0 */ /* Get start index of each weight */ {