From 5a7eb2255d8a84411259f0f7cb17ae731dd2301b Mon Sep 17 00:00:00 2001 From: Juan RP Date: Tue, 26 Nov 2013 10:31:16 +0100 Subject: [PATCH] Revert "lib/download.c: xbps_fetch_file: remove unnecesary memset() calls." This reverts commit 74970f2e921f0cc9ffbbfb569fc76e303eceae75. --- lib/download.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/download.c b/lib/download.c index 95a3787c..c4c3a7f3 100644 --- a/lib/download.c +++ b/lib/download.c @@ -115,6 +115,7 @@ xbps_fetch_file(struct xbps_handle *xhp, const char *uri, const char *flags) if ((url = fetchParseURL(uri)) == NULL) return -1; + memset(&fetch_flags, 0, sizeof(fetch_flags)); if (flags != NULL) strlcpy(fetch_flags, flags, 7); /* @@ -130,6 +131,7 @@ xbps_fetch_file(struct xbps_handle *xhp, const char *uri, const char *flags) /* * Check if we have to resume a transfer. */ + memset(&st_tmpfile, 0, sizeof(st_tmpfile)); if (stat(tempfile, &st_tmpfile) == 0) { if (st_tmpfile.st_size > 0) restart = true; @@ -142,6 +144,7 @@ xbps_fetch_file(struct xbps_handle *xhp, const char *uri, const char *flags) /* * Check if we have to refetch a transfer. */ + memset(&st, 0, sizeof(st)); if (stat(filename, &st) == 0) { refetch = true; url->last_modified = st.st_mtime;