From 8d7c899d48d6685fd3ac85d1428d9bd7a1766084 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Mon, 18 Nov 2013 18:23:31 +0100 Subject: [PATCH] lib/package_unpack.c: initiliaze struct rather than memset. --- lib/package_unpack.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/package_unpack.c b/lib/package_unpack.c index 50d05171..1e8c9de3 100644 --- a/lib/package_unpack.c +++ b/lib/package_unpack.c @@ -162,7 +162,7 @@ unpack_archive(struct xbps_handle *xhp, const struct stat *entry_statp; void *instbuf = NULL, *rembuf = NULL; struct stat st; - struct xbps_unpack_cb_data xucd; + struct xbps_unpack_cb_data xucd = {0}; struct archive_entry *entry; size_t instbufsiz = 0, rembufsiz = 0; ssize_t entry_size; @@ -195,10 +195,6 @@ unpack_archive(struct xbps_handle *xhp, if (xhp->flags & XBPS_FLAG_FORCE_UNPACK) force = true; - if (xhp->unpack_cb != NULL) { - /* initialize data for unpack cb */ - memset(&xucd, 0, sizeof(xucd)); - } if (access(xhp->rootdir, R_OK) == -1) { if (errno != ENOENT) { rv = errno;