From 8e7bcdd8064c1e0a817c7effe4bae39741c258d3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?P=C3=A1draig=20Brady?= Date: Sun, 19 Mar 2017 23:00:05 -0700 Subject: [PATCH] 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. --- src/expand-common.c | 2 ++ 1 file changed, 2 insertions(+) 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)); -- 2.47.3