From 853757df15383c2e9cc33023dc04a256c458e671 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 25 Apr 2013 22:18:26 +0300 Subject: fix some code style by cpplint. --- src/gui/userpalette.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/gui/userpalette.cpp') diff --git a/src/gui/userpalette.cpp b/src/gui/userpalette.cpp index 9077da6c0..e378aef6c 100644 --- a/src/gui/userpalette.cpp +++ b/src/gui/userpalette.cpp @@ -183,7 +183,8 @@ UserPalette::~UserPalette() if (col->grad == STATIC || col->grad == PULSE) { char buffer[20]; - sprintf(buffer, "0x%06x", col->getRGB()); + snprintf(buffer, sizeof(buffer), "0x%06x", col->getRGB()); + buffer[19] = 0; config.setValue(configName, std::string(buffer)); } } @@ -286,7 +287,8 @@ void UserPalette::addColor(const unsigned type, const unsigned rgb, const std::string &configName = ColorTypeNames[type]; char buffer[20]; - sprintf(buffer, "0x%06x", rgb); + snprintf(buffer, sizeof(buffer), "0x%06x", rgb); + buffer[19] = 0; const std::string rgbString = config.getValue(configName, std::string(buffer)); -- cgit v1.2.3-60-g2f50