[pacman-dev] [PATCH] Silence warning from clang
clang is wrong - dbfile is always used initialized in that function. Signed-off-by: Allan McRae <allan@archlinux.org> --- lib/libalpm/add.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libalpm/add.c b/lib/libalpm/add.c index ed29e68..e608107 100644 --- a/lib/libalpm/add.c +++ b/lib/libalpm/add.c @@ -148,7 +148,7 @@ static int extract_db_file(alpm_handle_t *handle, struct archive *archive, struct archive_entry *entry, alpm_pkg_t *newpkg, const char *entryname) { char filename[PATH_MAX]; /* the actual file we're extracting */ - const char *dbfile; + const char *dbfile = NULL; if(strcmp(entryname, ".INSTALL") == 0) { dbfile = "install"; } else if(strcmp(entryname, ".CHANGELOG") == 0) { -- 2.3.5
On Thu, Apr 23, 2015 at 1:02 AM, Allan McRae <allan@archlinux.org> wrote:
clang is wrong - dbfile is always used initialized in that function.
Signed-off-by: Allan McRae <allan@archlinux.org> --- I had to make this change somewhere too, so +1 from me.
Signed-off-by: Dan McGee <dan@archlinux.org>
lib/libalpm/add.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/libalpm/add.c b/lib/libalpm/add.c index ed29e68..e608107 100644 --- a/lib/libalpm/add.c +++ b/lib/libalpm/add.c @@ -148,7 +148,7 @@ static int extract_db_file(alpm_handle_t *handle, struct archive *archive, struct archive_entry *entry, alpm_pkg_t *newpkg, const char *entryname) { char filename[PATH_MAX]; /* the actual file we're extracting */ - const char *dbfile; + const char *dbfile = NULL; if(strcmp(entryname, ".INSTALL") == 0) { dbfile = "install"; } else if(strcmp(entryname, ".CHANGELOG") == 0) { -- 2.3.5
participants (2)
-
Allan McRae
-
Dan McGee