diff --git a/src/asm/main.cpp b/src/asm/main.cpp index bc79014a..bd0f0917 100644 --- a/src/asm/main.cpp +++ b/src/asm/main.cpp @@ -267,6 +267,7 @@ static void parseArg(int ch, char *arg) { } case 'r': + errno = 0; if (std::optional maxDepth = parseWholeNumber(arg); !maxDepth) { fatal("Invalid argument for option '-r'"); } else if (errno == ERANGE) { diff --git a/src/asm/opt.cpp b/src/asm/opt.cpp index 08978d41..70e5c94f 100644 --- a/src/asm/opt.cpp +++ b/src/asm/opt.cpp @@ -105,6 +105,7 @@ void opt_Parse(char const *s) { break; case 'r': + errno = 0; if (std::optional maxRecursionDepth = parseWholeNumber(s); !maxRecursionDepth) { error("Invalid argument for option 'r'"); } else if (errno == ERANGE) {