Check for valid SuperX number
This commit is contained in:
parent
d443e28147
commit
3368390f37
|
@ -387,7 +387,7 @@ int gamedata_read_tbl(int pc_shareware)
|
||||||
PHYSFSX_gets_line_t<LINEBUF_SIZE> inputline;
|
PHYSFSX_gets_line_t<LINEBUF_SIZE> inputline;
|
||||||
while (PHYSFSX_fgets(inputline, InfoFile)) {
|
while (PHYSFSX_fgets(inputline, InfoFile)) {
|
||||||
int l;
|
int l;
|
||||||
char *temp_ptr;
|
const char *temp_ptr;
|
||||||
int skip;
|
int skip;
|
||||||
|
|
||||||
linenum++;
|
linenum++;
|
||||||
|
@ -414,7 +414,10 @@ int gamedata_read_tbl(int pc_shareware)
|
||||||
SuperX = -1;
|
SuperX = -1;
|
||||||
|
|
||||||
if ( (temp_ptr=strstr( inputline, "superx=" )) ) {
|
if ( (temp_ptr=strstr( inputline, "superx=" )) ) {
|
||||||
SuperX = atoi( &temp_ptr[7] );
|
char *p;
|
||||||
|
auto s = strtol(&temp_ptr[7], &p, 10);
|
||||||
|
if (!*p)
|
||||||
|
SuperX = s;
|
||||||
}
|
}
|
||||||
|
|
||||||
char *arg = strtok( inputline, space );
|
char *arg = strtok( inputline, space );
|
||||||
|
|
Loading…
Reference in a new issue