From: Alejandro Colomar Date: Sat, 8 Feb 2025 15:36:26 +0000 (+0100) Subject: lib/salt.c: Use stprintf() instead of snprintf(3) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e6a7d7540866da1db7aa5f0bf10104df7c5c5ae4;p=thirdparty%2Fshadow.git lib/salt.c: Use stprintf() instead of snprintf(3) Signed-off-by: Alejandro Colomar --- diff --git a/lib/salt.c b/lib/salt.c index e662e03c1..4a66d0132 100644 --- a/lib/salt.c +++ b/lib/salt.c @@ -23,6 +23,7 @@ #include "getdef.h" #include "prototypes.h" #include "shadowlog.h" +#include "string/sprintf/stprintf.h" #include "string/strcmp/streq.h" #undef NDEBUG @@ -172,7 +173,7 @@ static /*@observer@*/void SHA_salt_rounds_to_buf (char *buf, unsigned long round */ assert (GENSALT_SETTING_SIZE > buf_begin + 17); - (void) snprintf (buf + buf_begin, 18, "rounds=%lu$", rounds); + stprintf(buf + buf_begin, 18, "rounds=%lu$", rounds); } #ifdef USE_BCRYPT @@ -250,7 +251,7 @@ static /*@observer@*/void BCRYPT_salt_rounds_to_buf (char *buf, unsigned long ro */ assert (GENSALT_SETTING_SIZE > buf_begin + 3); - (void) snprintf (buf + buf_begin, 4, "%2.2lu$", rounds); + stprintf(buf + buf_begin, 4, "%2.2lu$", rounds); } #endif /* USE_BCRYPT */