(svn r26486) -Codechange: replace a number of snprintfs with seprintf

This commit is contained in:
rubidium
2014-04-23 21:12:09 +00:00
parent ef4c2ce031
commit 5b82822c12
26 changed files with 61 additions and 59 deletions

View File

@@ -14,6 +14,7 @@
#include "../core/random_func.hpp"
#include "script_info.hpp"
#include "../textfile_gui.h"
#include "../string_func.h"
#include "../safeguards.h"
@@ -188,7 +189,7 @@ void ScriptConfig::SettingsToString(char *string, size_t size) const
string[0] = '\0';
for (SettingValueList::const_iterator it = this->settings.begin(); it != this->settings.end(); it++) {
char no[10];
snprintf(no, sizeof(no), "%d", (*it).second);
seprintf(no, lastof(no), "%d", (*it).second);
/* Check if the string would fit in the destination */
size_t needed_size = strlen((*it).first) + 1 + strlen(no) + 1;