From dd1db3753ecf8a4d782aee1f518759763d8caf87 Mon Sep 17 00:00:00 2001 From: Thorbjørn Lindeijer Date: Wed, 28 Feb 2024 09:35:42 +0100 Subject: 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. --- src/gui/setup_colors.cpp | 6 +----- 1 file changed, 1 insertion(+), 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); } -- cgit v1.2.3-70-g09d2