summaryrefslogtreecommitdiff
path: root/src/resources
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-03-13 13:38:33 +0100
committerThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-03-13 14:46:18 +0000
commit7a110c36b58478b633a694ba74a1cb17d237c3df (patch)
tree1f551bd9a8e956e96c9507435d9d69b5f4fd7be3 /src/resources
parentded13d1ebfd7aa63a3ec9075e72e26b87ad416a0 (diff)
downloadmana-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/resources')
-rw-r--r--src/resources/userpalette.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/resources/userpalette.cpp b/src/resources/userpalette.cpp
index 16a19d19..12e4d5bc 100644
--- a/src/resources/userpalette.cpp
+++ b/src/resources/userpalette.cpp
@@ -121,7 +121,7 @@ UserPalette::~UserPalette()
if (color.grad == STATIC || color.grad == PULSE)
{
char buffer[20];
- sprintf(buffer, "0x%06x", color.getRGB());
+ snprintf(buffer, 20, "0x%06x", color.getRGB());
config.setValue(configName, std::string(buffer));
}
}
@@ -220,7 +220,7 @@ void UserPalette::addColor(int type, int rgb, Palette::GradientType grad,
{
const std::string &configName = ColorTypeNames[type];
char buffer[20];
- sprintf(buffer, "0x%06x", rgb);
+ snprintf(buffer, 20, "0x%06x", rgb);
const std::string rgbString = config.getValue(configName,
std::string(buffer));
unsigned int rgbValue = 0;