diff options
Diffstat (limited to 'src/apps')
| -rw-r--r-- | src/apps/cct.cpp | 2 | ||||
| -rw-r--r-- | src/apps/cs2cs.cpp | 8 | ||||
| -rw-r--r-- | src/apps/gie.cpp | 2 | ||||
| -rw-r--r-- | src/apps/projinfo.cpp | 8 |
4 files changed, 16 insertions, 4 deletions
diff --git a/src/apps/cct.cpp b/src/apps/cct.cpp index 4f21f10a..ca62c570 100644 --- a/src/apps/cct.cpp +++ b/src/apps/cct.cpp @@ -455,7 +455,7 @@ int main(int argc, char **argv) { size_t len = strlen(comment); if (len >= 1) comment[len - 1] = '\0'; - comment_delimiter = (comment && *comment) ? whitespace : blank_comment; + comment_delimiter = *comment ? whitespace : blank_comment; /* Time to print the result */ /* use same arguments to printf format string for both radians and 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; diff --git a/src/apps/gie.cpp b/src/apps/gie.cpp index 95c7da34..07c06dd9 100644 --- a/src/apps/gie.cpp +++ b/src/apps/gie.cpp @@ -958,7 +958,7 @@ Tell GIE what to expect, when transforming the ACCEPTed input err_const_from_errno(proj_errno(T.P)), proj_errno (T.P), expect_failure_with_errno, - F->lineno + static_cast<int>(F->lineno) ); return another_failing_failure (); } diff --git a/src/apps/projinfo.cpp b/src/apps/projinfo.cpp index 8c266e94..71830f00 100644 --- a/src/apps/projinfo.cpp +++ b/src/apps/projinfo.cpp @@ -942,7 +942,13 @@ int main(int argc, char **argv) { } } else if (arg == "--accuracy" && i + 1 < argc) { i++; - minimumAccuracy = c_locale_stod(argv[i]); + try { + minimumAccuracy = c_locale_stod(argv[i]); + } catch (const std::exception &e) { + std::cerr << "Invalid value for option --accuracy: " << e.what() + << std::endl; + usage(); + } } else if (arg == "--area" && i + 1 < argc) { i++; area = argv[i]; |
