diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-04-25 22:18:26 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-04-25 22:18:26 +0300 |
commit | 853757df15383c2e9cc33023dc04a256c458e671 (patch) | |
tree | f12cf49d6ddc17b6b4fc96d066359872b108f144 /src/gui/userpalette.cpp | |
parent | 8e57e80d73a58077615924d50ac206d19efddae6 (diff) | |
download | manaverse-853757df15383c2e9cc33023dc04a256c458e671.tar.gz manaverse-853757df15383c2e9cc33023dc04a256c458e671.tar.bz2 manaverse-853757df15383c2e9cc33023dc04a256c458e671.tar.xz manaverse-853757df15383c2e9cc33023dc04a256c458e671.zip |
fix some code style by cpplint.
Diffstat (limited to 'src/gui/userpalette.cpp')
-rw-r--r-- | src/gui/userpalette.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
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)); |