Truncate any existing avatar file when saving in cache dir.

This commit is contained in:
lotodore
2007-11-11 15:59:41 +00:00
parent d905359251
commit f1f45c9b0b
+1 -1
View File
@@ -359,7 +359,7 @@ AvatarManager::StoreAvatarInCache(const MD5Buf &md5buf, AvatarFileType avatarFil
path tmpPath(cacheDir);
tmpPath /= (md5buf.ToString() + ext);
string fileName(tmpPath.file_string());
ofstream o(fileName.c_str(), ios_base::out | ios_base::binary);
ofstream o(fileName.c_str(), ios_base::out | ios_base::binary | ios_base::trunc);
if (!o.fail())
{
o.write((const char *)data, size);