]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
silence array subscript warning
authorYann Collet <yann.collet.73@gmail.com>
Fri, 19 Feb 2016 14:16:15 +0000 (15:16 +0100)
committerYann Collet <yann.collet.73@gmail.com>
Fri, 19 Feb 2016 14:16:15 +0000 (15:16 +0100)
lib/huff0.c

index 929bc87b1569ba35dd66b553148da75b239212d8..d17493729dbe7d090965bbf9daa738657f7788f6 100644 (file)
@@ -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 */
     {