X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/74b220028595342028e3309002e4ec359af328f9..df7d029c6d7ff15b81f7b439991bfaef19adcaf6:/apt-inst/extract.cc?ds=sidebyside diff --git a/apt-inst/extract.cc b/apt-inst/extract.cc index d48ff63ac..2c95fba92 100644 --- a/apt-inst/extract.cc +++ b/apt-inst/extract.cc @@ -49,6 +49,7 @@ #include #include #include +#include #include #include @@ -80,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 */ @@ -182,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"),