git repos / blockattack-game

commit bbb1d879

sago007 · 2016-06-10 19:50
bbb1d8798c550087569a570552630e41617834dd patch · browse files
parent b84f3eeea1ac9ee91dd70a3b6d0af0711f5b0616

Removed use of an unsafe function

Changed files

M source/code/main.cpp before
diff --git a/source/code/main.cpp b/source/code/main.cpp index dbd499b..5b39ac1 100644 --- a/source/code/main.cpp +++ b/source/code/main.cpp
@@ -550,6 +550,7 @@ static TextManager theTextManager;
#include "ScoresDisplay.hpp"
#include "BlockGameSdl.inc"
+#include "sago/SagoMisc.hpp"
@@ -1149,7 +1150,7 @@ int main(int argc, char* argv[]) {
int consoleWidth = boost::program_options::options_description::m_default_line_length;
const char* columnsEnv = getenv("COLUMNS"); // Allows using "COLUMNS=300 help2man" for generating the man page without bad line breaks.
if (columnsEnv) {
- consoleWidth = atoi(columnsEnv);
+ consoleWidth = sago::StrToLong(columnsEnv);
}
const char* commandname = "blockattack";
if (argv[0]) {