mirror of
https://github.com/aria2/aria2.git
synced 2025-04-05 13:37:40 +03:00
Merge pull request #2117 from egorenar/fix-formatr-string-overflow-in-logger-writeheader
Logger: Fix format string overflow in writeHeader()
This commit is contained in:
commit
076dea3896
1 changed files with 2 additions and 2 deletions
|
@ -133,8 +133,8 @@ void writeHeader(Output& fp, Logger::LEVEL level, const char* sourceFile,
|
||||||
size_t dateLength =
|
size_t dateLength =
|
||||||
strftime(datestr, sizeof(datestr), "%Y-%m-%d %H:%M:%S", &tm);
|
strftime(datestr, sizeof(datestr), "%Y-%m-%d %H:%M:%S", &tm);
|
||||||
assert(dateLength <= (size_t)20);
|
assert(dateLength <= (size_t)20);
|
||||||
fp.printf("%s.%06ld [%s] [%s:%d] ", datestr, tv.tv_usec, levelToString(level),
|
fp.printf("%s.%06ld [%s] [%s:%d] ", datestr, (unsigned long)tv.tv_usec,
|
||||||
sourceFile, lineNum);
|
levelToString(level), sourceFile, lineNum);
|
||||||
}
|
}
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue