mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-30 18:04:09 +03:00
Replace all usages of atoi() with help.Int()
This will prevent any undefined behavior that might occur as a result of having invalid input passed into atoi().
This commit is contained in:
@@ -3974,7 +3974,7 @@ void scriptclass::loadcustom(const std::string& t)
|
||||
add("text(blue,0,0,"+words[1]+")");
|
||||
break;
|
||||
}
|
||||
int ti=atoi(words[1].c_str());
|
||||
int ti=help.Int(words[1].c_str());
|
||||
int nti = ti>=0 && ti<=50 ? ti : 1;
|
||||
for(int ti2=0; ti2<nti; ti2++){
|
||||
i++;
|
||||
@@ -3999,7 +3999,7 @@ void scriptclass::loadcustom(const std::string& t)
|
||||
if(squeakmode==0) add("squeak(player)");
|
||||
add("text(cyan,0,0,"+words[1]+")");
|
||||
|
||||
int ti=atoi(words[1].c_str());
|
||||
int ti=help.Int(words[1].c_str());
|
||||
int nti = ti>=0 && ti<=50 ? ti : 1;
|
||||
for(int ti2=0; ti2<nti; ti2++){
|
||||
i++;
|
||||
|
||||
Reference in New Issue
Block a user