From d812245dd5ac9268ef060a243ac978074504ecca Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 13 Dec 2017 12:28:22 +0100 Subject: clearing object via constructor instead of memset Reported-By: gcc -Wclass-memaccess Gbp-Dch: Ignore --- apt-private/private-search.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apt-private') diff --git a/apt-private/private-search.cc b/apt-private/private-search.cc index b850339f9..7ec1915a8 100644 --- a/apt-private/private-search.cc +++ b/apt-private/private-search.cc @@ -164,6 +164,7 @@ struct ExDescFile pkgCache::DescFile *Df; pkgCache::VerIterator V; map_id_t ID; + ExDescFile() : Df(nullptr), ID(0) {} }; static bool Search(CommandLine &CmdL) { @@ -203,7 +204,6 @@ static bool Search(CommandLine &CmdL) size_t const descCount = Cache->HeaderP->GroupCount + 1; ExDescFile *DFList = new ExDescFile[descCount]; - memset(DFList,0,sizeof(*DFList) * descCount); bool *PatternMatch = new bool[descCount * NumPatterns]; memset(PatternMatch,false,sizeof(*PatternMatch) * descCount * NumPatterns); -- cgit v1.2.3