Replace snprintf with string and ostringstream (#1649)

These uses are probably safe from a buffer overflow perspective but
can cause data race issues in logging due to static buffers.
This commit is contained in:
Andrew Gaul
2021-05-08 02:48:47 +09:00
committed by GitHub
parent 096a230b70
commit bb6d2b1b74
5 changed files with 33 additions and 41 deletions

View File

@ -909,7 +909,7 @@ bool FdManager::CheckAllCache()
}
// print head message
S3FS_PRN_CACHE(fp, CACHEDBG_FMT_HEAD, S3fsLog::GetCurrentTime());
S3FS_PRN_CACHE(fp, CACHEDBG_FMT_HEAD, S3fsLog::GetCurrentTime().c_str());
// Loop in directory of cache file's stats
std::string top_path = CacheFileStat::GetCacheFileStatTopDir();