mirror of
https://github.com/gbdev/rgbds.git
synced 2026-08-20 13:54:33 +00:00
Reset errno = 0 before parseWholeNumber calls and errno == ERANGE checks
This commit is contained in:
@@ -267,6 +267,7 @@ static void parseArg(int ch, char *arg) {
|
||||
}
|
||||
|
||||
case 'r':
|
||||
errno = 0;
|
||||
if (std::optional<uint64_t> maxDepth = parseWholeNumber(arg); !maxDepth) {
|
||||
fatal("Invalid argument for option '-r'");
|
||||
} else if (errno == ERANGE) {
|
||||
|
||||
@@ -105,6 +105,7 @@ void opt_Parse(char const *s) {
|
||||
break;
|
||||
|
||||
case 'r':
|
||||
errno = 0;
|
||||
if (std::optional<uint64_t> maxRecursionDepth = parseWholeNumber(s); !maxRecursionDepth) {
|
||||
error("Invalid argument for option 'r'");
|
||||
} else if (errno == ERANGE) {
|
||||
|
||||
Reference in New Issue
Block a user