mlog: terminate a string at last char, just in case

This commit is contained in:
moneromooo-monero 2017-12-09 19:33:26 +00:00
parent d753d716a6
commit 38c8f4e0a3
No known key found for this signature in database
GPG Key ID: 686F07454D6CEFC3
1 changed files with 1 additions and 0 deletions

View File

@ -59,6 +59,7 @@ static std::string generate_log_filename(const char *base)
strcpy(tmp, "unknown");
else
strftime(tmp, sizeof(tmp), "%Y-%m-%d-%H-%M-%S", &tm);
tmp[sizeof(tmp) - 1] = 0;
filename += "-";
filename += tmp;
return filename;