fix: non-portable strftime format string (#2290)

Xref: b61b1e2c16
This commit is contained in:
Charles Kerr 2021-12-09 14:30:39 -06:00 committed by GitHub
parent b9de5bb9ca
commit d5aead4b41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -1844,7 +1844,7 @@ static void torrentCallScript(tr_torrent const* tor, char const* script)
struct tm tm;
char ctime_str[32];
tr_localtime_r(&now, &tm);
strftime(ctime_str, sizeof(ctime_str), "%a %b %2e %T %Y%n", &tm); /* ctime equiv */
strftime(ctime_str, sizeof(ctime_str), "%a %b %d %T %Y%n", &tm); /* ctime equiv */
char* const torrent_dir = tr_sys_path_native_separators(tr_strdup(tor->currentDir));

View File

@ -934,7 +934,7 @@ static char* format_date(char* buf, size_t buflen, time_t now)
{
struct tm tm;
tr_localtime_r(&now, &tm);
strftime(buf, buflen, "%a %b %2e %T %Y%n", &tm); /* ctime equiv */
strftime(buf, buflen, "%a %b %d %T %Y%n", &tm); /* ctime equiv */
return buf;
}