Reset errno = 0 before parseWholeNumber calls and errno == ERANGE checks

This commit is contained in:
Rangi
2026-07-07 17:02:46 -04:00
parent 30fd4514dc
commit ed8e3e4d02
2 changed files with 2 additions and 0 deletions
+1
View File
@@ -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) {