Skip to content

Commit

Permalink
cleanup: Remove our only use of sprintf.
Browse files Browse the repository at this point in the history
Replaced with snprintf.
  • Loading branch information
iphydf committed Jan 15, 2022
1 parent 8d19757 commit fdacd81
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion toxcore/Messenger.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit fdacd81

Please sign in to comment.