summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-02-28 09:35:42 +0100
committerThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-02-28 09:35:42 +0100
commitdd1db3753ecf8a4d782aee1f518759763d8caf87 (patch)
tree75f5fad47926a41738d7f50ed01b76333299a753
parent254c3db4a39aa35274fd7cd4ec2cccde5b92d71b (diff)
downloadmana-dd1db3753ecf8a4d782aee1f518759763d8caf87.tar.gz
mana-dd1db3753ecf8a4d782aee1f518759763d8caf87.tar.bz2
mana-dd1db3753ecf8a4d782aee1f518759763d8caf87.tar.xz
mana-dd1db3753ecf8a4d782aee1f518759763d8caf87.zip
Use snprintf instead of sprintf
Using sprintf triggers a warning on macOS. The buffer should be large enough, but a little extra security doesn't hurt.
-rw-r--r--src/gui/setup_colors.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/gui/setup_colors.cpp b/src/gui/setup_colors.cpp
index 69420496..880f6f8a 100644
--- a/src/gui/setup_colors.cpp
+++ b/src/gui/setup_colors.cpp
@@ -21,12 +21,9 @@
#include "gui/setup_colors.h"
-#include "configuration.h"
-
#include "gui/gui.h"
#include "gui/widgets/browserbox.h"
-#include "gui/widgets/itemlinkhandler.h"
#include "gui/widgets/label.h"
#include "gui/widgets/layout.h"
#include "gui/widgets/listbox.h"
@@ -35,7 +32,6 @@
#include "gui/widgets/textfield.h"
#include "gui/widgets/textpreview.h"
-#include "resources/theme.h"
#include "resources/userpalette.h"
#include "utils/gettext.h"
@@ -272,7 +268,7 @@ void Setup_Colors::setEntry(gcn::Slider *s, TextField *t, int value)
{
s->setValue(value);
char buffer[100];
- sprintf(buffer, "%d", value);
+ snprintf(buffer, 100, "%d", value);
t->setText(buffer);
}