suppressed uninitialized memory due to empty cache file

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2274 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2010-02-10 20:24:30 +00:00
parent 467f8f7287
commit d00739ce7b
2 changed files with 20 additions and 14 deletions

View File

@ -679,6 +679,8 @@ void FileIndexMonitor::locked_saveFileIndexes()
fi.saveIndex(fname_total, calchash, sizetmp,std::set<std::string>()); // save all files
fi.saveIndex(fname_browsable, calchash, size,forbidden_dirs); // save only browsable files
if(size > 0)
{
#ifdef FIM_DEBUG
std::cerr << "FileIndexMonitor::updateCycle() saved with hash:" << calchash;
std::cerr << std::endl;
@ -698,6 +700,7 @@ void FileIndexMonitor::locked_saveFileIndexes()
data.recvd = time(NULL);
updateCache(data);
}
#ifdef FIM_DEBUG
std::cerr << "FileIndexMonitor::updateCycle() called updateCache()";

View File

@ -923,6 +923,9 @@ int FileIndex::saveIndex(std::string filename, std::string &fileHash, uint64_t &
std::ofstream file (filenametmp.c_str(), std::ofstream::binary);
std::ostringstream oss;
size = 0 ;
fileHash = "" ;
if (!file)
{
#ifdef FI_DEBUG