diff options
author | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-03-13 13:38:33 +0100 |
---|---|---|
committer | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-03-13 14:46:18 +0000 |
commit | 7a110c36b58478b633a694ba74a1cb17d237c3df (patch) | |
tree | 1f551bd9a8e956e96c9507435d9d69b5f4fd7be3 /src/utils/stringutils.cpp | |
parent | ded13d1ebfd7aa63a3ec9075e72e26b87ad416a0 (diff) | |
download | mana-7a110c36b58478b633a694ba74a1cb17d237c3df.tar.gz mana-7a110c36b58478b633a694ba74a1cb17d237c3df.tar.bz2 mana-7a110c36b58478b633a694ba74a1cb17d237c3df.tar.xz mana-7a110c36b58478b633a694ba74a1cb17d237c3df.zip |
Use snprintf instead of sprintf
Amendment of dd1db3753ecf8a4d782aee1f518759763d8caf87.
Diffstat (limited to 'src/utils/stringutils.cpp')
-rw-r--r-- | src/utils/stringutils.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/utils/stringutils.cpp b/src/utils/stringutils.cpp index 32fc3b0c..a1637892 100644 --- a/src/utils/stringutils.cpp +++ b/src/utils/stringutils.cpp @@ -73,11 +73,11 @@ const char *ipToString(int address) { static char asciiIP[16]; - sprintf(asciiIP, "%i.%i.%i.%i", - (unsigned char)(address), - (unsigned char)(address >> 8), - (unsigned char)(address >> 16), - (unsigned char)(address >> 24)); + snprintf(asciiIP, 16, "%i.%i.%i.%i", + (unsigned char)(address), + (unsigned char)(address >> 8), + (unsigned char)(address >> 16), + (unsigned char)(address >> 24)); return asciiIP; } |