CDVD: check return value of ToLong

Reported by coverity
This commit is contained in:
Gregory Hainaut 2016-11-12 19:36:44 +01:00
parent 356429d0e7
commit c5d727da39
1 changed files with 5 additions and 1 deletions

View File

@ -429,7 +429,11 @@ void cdvdReloadElfInfo(wxString elfoverride)
static __fi s32 StrToS32(const wxString& str, int base = 10)
{
long l;
str.ToLong(&l, base);
if (!str.ToLong(&l, base)) {
Console.Error(L"StrToS32: fail to translate '%s' as long", WX_STR(str));
return 0;
}
return l;
}