lib/package_unpack.c: silence gcc false positive

On some systems, something like this happens:

package_unpack.c:375:11: error: 'buf' may be used uninitialized in this function

This is not actually a bug as logically `buf` is always initialized
in that place, but gcc doesn't like it anyway.
This commit is contained in:
q66 2019-06-21 03:34:27 +02:00 committed by Juan RP
parent 9c300a93d1
commit a72cbf3c23

View File

@ -84,7 +84,7 @@ unpack_archive(struct xbps_handle *xhp,
size_t instbufsiz = 0, rembufsiz = 0; size_t instbufsiz = 0, rembufsiz = 0;
ssize_t entry_size; ssize_t entry_size;
const char *entry_pname, *transact, *binpkg_pkgver; const char *entry_pname, *transact, *binpkg_pkgver;
char *pkgname, *buf; char *pkgname, *buf = NULL;
int ar_rv, rv, error, entry_type, flags; int ar_rv, rv, error, entry_type, flags;
bool preserve, update, file_exists, keep_conf_file; bool preserve, update, file_exists, keep_conf_file;
bool skip_extract, force, xucd_stats; bool skip_extract, force, xucd_stats;