Commit 96130a48 authored by Philippe Gorley's avatar Philippe Gorley Committed by Hugo Lefeuvre

tlsvalidator: fix compilation warning

Output of strftime is garanteed to be null terminated if format is null
terminated. The man page for strftime specifies "The  characters  of
ordinary character sequences (including the null byte) are copied
verbatim from format to s."

Change-Id: Ie3ccdda52bf0a69efb9958a17c73fb79b8a41fab
Reviewed-by: default avatarHugo Lefeuvre <hugo.lefeuvre@savoirfairelinux.com>
parent a0cbc6ff
......@@ -421,7 +421,7 @@ static TlsValidator::CheckResult formatDate(const time_t time)
{
char buffer[12];
struct tm* timeinfo = localtime(&time);
strftime(buffer, sizeof(buffer), "%F\0", timeinfo);
strftime(buffer, sizeof(buffer), "%F", timeinfo);
return TlsValidator::CheckResult(TlsValidator::CheckValues::ISO_DATE, buffer);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment