mirror of
https://github.com/outbackdingo/UltraGrid.git
synced 2026-03-21 16:40:18 +00:00
unify stod/stoi invalid_argument::what parse
This is a hack to check whether given invalid_argument message belongs to stoi/stod. It is usually used to catch non-numeric user input where a number was expected.
This commit is contained in:
@@ -1013,8 +1013,7 @@ parse_options(int argc, char *argv[], struct ug_options *opt)
|
||||
try {
|
||||
return parse_options_internal(argc, argv, opt);
|
||||
} catch (logic_error &e) {
|
||||
if (strcmp(e.what(), "stoi") != 0 &&
|
||||
strcmp(e.what(), "stod") != 0) {
|
||||
if (!invalid_arg_is_numeric(e.what())) {
|
||||
throw;
|
||||
}
|
||||
if (dynamic_cast<invalid_argument *>(&e) != nullptr) {
|
||||
|
||||
Reference in New Issue
Block a user