From: Michihiro NAKAJIMA Date: Tue, 28 Feb 2012 10:06:38 +0000 (+0900) Subject: Avoid the error which Clang Static Analyzer says "Function call argument is an uninit... X-Git-Tag: v3.0.4~2^2~34 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=27d571df37763d10f9add34279c9e20504f74507;p=thirdparty%2Flibarchive.git Avoid the error which Clang Static Analyzer says "Function call argument is an uninitialized value" but actually it might not happen. --- diff --git a/libarchive/archive_ppmd7.c b/libarchive/archive_ppmd7.c index 10ae2aeab..13a258188 100644 --- a/libarchive/archive_ppmd7.c +++ b/libarchive/archive_ppmd7.c @@ -415,7 +415,7 @@ static CTX_PTR CreateSuccessors(CPpmd7 *p, Bool skip) upState.Freq = (Byte)(1 + ((2 * cf <= s0) ? (5 * cf > s0) : ((2 * cf + 3 * s0 - 1) / (2 * s0)))); } - do + while (numPs != 0) { /* Create Child */ CTX_PTR c1; /* = AllocContext(p); */ @@ -435,7 +435,6 @@ static CTX_PTR CreateSuccessors(CPpmd7 *p, Bool skip) SetSuccessor(ps[--numPs], REF(c1)); c = c1; } - while (numPs != 0); return c; }