Replace sprintf with snprintf.
Chaos Ci / test (push) Successful in 2m57s
Chaos Ci / benchmark (push) Successful in 1m47s

This commit is contained in:
hashlag
2026-08-04 00:40:53 +03:00
parent d894cffa04
commit a44d537779
3 changed files with 22 additions and 22 deletions
+1 -1
View File
@@ -147,7 +147,7 @@ struct Md4Hash : public Hash<Md4Hash>
{
char buf[33];
std::sprintf(buf,
std::snprintf(buf, sizeof(buf),
"%02x%02x%02x%02x%02x%02x%02x%02x"
"%02x%02x%02x%02x%02x%02x%02x%02x",
RawDigest_[ 0], RawDigest_[ 1], RawDigest_[ 2], RawDigest_[ 3],
+1 -1
View File
@@ -171,7 +171,7 @@ struct Md5Hash : public Hash<Md5Hash>
{
char buf[33];
std::sprintf(buf,
std::snprintf(buf, sizeof(buf),
"%02x%02x%02x%02x%02x%02x%02x%02x"
"%02x%02x%02x%02x%02x%02x%02x%02x",
RawDigest_[ 0], RawDigest_[ 1], RawDigest_[ 2], RawDigest_[ 3],
+1 -1
View File
@@ -140,7 +140,7 @@ struct Sha1Hash : public Hash<Sha1Hash>
{
char buf[41];
std::sprintf(buf,
std::snprintf(buf, sizeof(buf),
"%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x"
"%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x",
RawDigest_[ 0], RawDigest_[ 1], RawDigest_[ 2], RawDigest_[ 3],