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:
Misa
2020-08-06 21:31:29 -07:00
committed by Ethan Lee
parent 037065910f
commit 78e87effe7
4 changed files with 129 additions and 129 deletions

View File

@@ -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++;