From 69c2ecbdc937e3c73fe67d3c9bce12a80d3ec7ec Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sun, 10 Mar 2013 12:24:13 +0100 Subject: various simple changes to fix cppcheck warnings --- apt-inst/extract.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'apt-inst/extract.cc') diff --git a/apt-inst/extract.cc b/apt-inst/extract.cc index 29e163028..2c95fba92 100644 --- a/apt-inst/extract.cc +++ b/apt-inst/extract.cc @@ -81,8 +81,6 @@ pkgExtract::pkgExtract(pkgFLCache &FLCache,pkgCache::VerIterator Ver) : /* This performs the setup for the extraction.. */ bool pkgExtract::DoItem(Item &Itm,int &Fd) { - char Temp[sizeof(FileName)]; - /* Strip any leading/trailing /s from the filename, then copy it to the temp buffer and re-apply the leading / We use a class variable to store the new filename for use by the three extraction funcs */ @@ -183,6 +181,7 @@ bool pkgExtract::DoItem(Item &Itm,int &Fd) // See if we can recover the backup file if (Nde.end() == false) { + char Temp[sizeof(FileName)]; snprintf(Temp,sizeof(Temp),"%s.%s",Itm.Name,TempExt); if (rename(Temp,Itm.Name) != 0 && errno != ENOENT) return _error->Errno("rename",_("Failed to rename %s to %s"), -- cgit v1.2.3