From fdacd81524cc614a2d42564c9c5b6b6bc4770149 Mon Sep 17 00:00:00 2001 From: iphydf Date: Sat, 15 Jan 2022 00:52:51 +0000 Subject: [PATCH] cleanup: Remove our only use of sprintf. Replaced with snprintf. --- toxcore/Messenger.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toxcore/Messenger.c b/toxcore/Messenger.c index 94e2c47fb3..4ccd106ecf 100644 --- a/toxcore/Messenger.c +++ b/toxcore/Messenger.c @@ -2475,7 +2475,7 @@ static char *id_to_string(const uint8_t *pk, char *id_str, size_t length) } for (uint32_t i = 0; i < CRYPTO_PUBLIC_KEY_SIZE; ++i) { - sprintf(&id_str[i * 2], "%02X", pk[i]); + snprintf(&id_str[i * 2], length - i * 2, "%02X", pk[i]); } id_str[CRYPTO_PUBLIC_KEY_SIZE * 2] = 0;