From b8c08dda06a85336f8c8f085db20118101803c35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Lucas=20Golini?= Date: Sun, 20 Aug 2023 22:03:06 -0300 Subject: [PATCH] Clean up a couple of warnings. --- src/eepp/network/uri.cpp | 2 +- src/eepp/system/md5.cpp | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/eepp/network/uri.cpp b/src/eepp/network/uri.cpp index 9370f4d0a..371605019 100644 --- a/src/eepp/network/uri.cpp +++ b/src/eepp/network/uri.cpp @@ -6,7 +6,7 @@ static void AppendHex( std::string& str, int value, int width ) { eeASSERT( width > 0 && width < 64 ); char buffer[64]; - std::sprintf( buffer, "%0*X", width, value ); + std::snprintf( buffer, 64, "%0*X", width, value ); str.append( buffer ); } diff --git a/src/eepp/system/md5.cpp b/src/eepp/system/md5.cpp index 82a48af75..657f0e7b0 100644 --- a/src/eepp/system/md5.cpp +++ b/src/eepp/system/md5.cpp @@ -183,9 +183,8 @@ std::string MD5::hexDigest( std::vector& digest ) { char buf[33]; size_t size = digest.size(); - for ( size_t i = 0; i < size; i++ ) { - sprintf( buf + i * 2, "%02x", digest[i] ); - } + for ( size_t i = 0; i < size; i++ ) + snprintf( buf + i * 2, size - i + 2, "%02x", digest[i] ); buf[32] = 0;