diff options
Diffstat (limited to 'src/apps/cs2cs.cpp')
| -rw-r--r-- | src/apps/cs2cs.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/apps/cs2cs.cpp b/src/apps/cs2cs.cpp index 5542a282..19f924d4 100644 --- a/src/apps/cs2cs.cpp +++ b/src/apps/cs2cs.cpp @@ -422,7 +422,13 @@ int main(int argc, char **argv) { emess(1, "missing argument for --accuracy"); std::exit(1); } - accuracy = c_locale_stod(*argv); + try { + accuracy = c_locale_stod(*argv); + } catch (const std::exception &e) { + std::cerr << "Invalid value for option --accuracy: " + << e.what() << std::endl; + std::exit(1); + } } else if (strcmp(*argv, "--authority") == 0 ) { ++argv; |
