From: Pádraig Brady Date: Mon, 20 Mar 2017 06:00:05 +0000 (-0700) Subject: maint: avoid a static analysis warning in expand-common X-Git-Tag: v8.28~102 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8e7bcdd8064c1e0a817c7effe4bae39741c258d3;p=thirdparty%2Fcoreutils.git maint: avoid a static analysis warning in expand-common * src/expand-common.c (next_file): We're dependent on calling this function with NULL to initialize things appropriately. So enforce this with assert(), which avoids a warning from clang-anaylzer. --- diff --git a/src/expand-common.c b/src/expand-common.c index 0728e70d0d..e1b549fab1 100644 --- a/src/expand-common.c +++ b/src/expand-common.c @@ -16,6 +16,7 @@ #include +#include #include #include #include "system.h" @@ -282,6 +283,7 @@ next_file (FILE *fp) if (fp) { + assert (prev_file); if (ferror (fp)) { error (0, errno, "%s", quotef (prev_file));