Skip to content
Snippets Groups Projects
Commit 1846db79 authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

Attempt to fix Coverity CID 454296

This is that rare case where a Coverity fix makes the code more
obvious and shorter.
parent c1b8cdbb
No related branches found
No related tags found
No related merge requests found
......@@ -434,7 +434,8 @@ static void lzh_update(lzh_t* lzh, short int c)
/* swap nodes to keep the tree freq-ordered */
if (((unsigned)k) > ((unsigned)lzh->freq[l = c + 1])) {
while (l < (sizeof(lzh->freq) / sizeof(lzh->freq[0]) - 1) && k > lzh->freq[++l]);
while (l < LZH_T && k > lzh->freq[++l])
;
l--;
lzh->freq[c] = lzh->freq[l];
lzh->freq[l] = k;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment