mirror of
https://github.com/izzy2lost/dolphin.git
synced 2026-06-19 01:16:48 -07:00
Reset errno to zero before testing it after the strtoul call. Fixes issue 5078.
This commit is contained in:
@@ -125,6 +125,10 @@ std::string StripQuotes(const std::string& s)
|
||||
bool TryParse(const std::string &str, u32 *const output)
|
||||
{
|
||||
char *endptr = NULL;
|
||||
|
||||
// Reset errno to a value other than ERANGE
|
||||
errno = 0;
|
||||
|
||||
unsigned long value = strtoul(str.c_str(), &endptr, 0);
|
||||
|
||||
if (!endptr || *endptr)
|
||||
|
||||
Reference in New Issue
Block a user