[mapcode] 02/32: Fixed encoder args

Stefan Fritsch sf at moszumanska.debian.org
Wed Nov 2 23:27:14 UTC 2016


This is an automated email from the git hooks/post-receive script.

sf pushed a commit to annotated tag v1.33
in repository mapcode.

commit 17569c7e06bbe4efd31889e9cc4ddf6e0bfaa358
Author: Rijn Buve <rijn at buve.nl>
Date:   Tue Aug 19 19:28:51 2014 +0200

    Fixed encoder args
---
 mapcode.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/mapcode.c b/mapcode.c
index 8826851..4cd7525 100644
--- a/mapcode.c
+++ b/mapcode.c
@@ -71,21 +71,21 @@ int main(const int argc, const char** argv)
     else if ((strcmp(cmd, "-e") == 0) || (strcmp(cmd, "--encode") == 0)) {
 
         // Encode: [-e | --encode] <lat:-90..90> <lon:-180..180> [country-ISO3]>
-        if ((argc != 3) && (argc != 4)) {
+        if ((argc != 4) && (argc != 5)) {
             usage(appName);
             return -1;
         }
-        const double lat = atof(argv[1]);
-        const double lon = atof(argv[2]);
+        const double lat = atof(argv[2]);
+        const double lon = atof(argv[3]);
 
         const char* results[32];
         int context = 0;
         if (argc == 4) {
-            context = text2tc(argv[3], 0);
+            context = text2tc(argv[4], 0);
         }
         const int nrResults = coord2mc(results, lat, lon, context);
         if (nrResults == 0) {
-            printf("error: cannot encode lat=%s, lon=%s (default country='%s')\n", argv[1], argv[2], (argc == 4) ? argv[3] : "none");
+            printf("error: cannot encode lat=%s, lon=%s (default country='%s')\n", argv[2], argv[3], (argc == 5) ? argv[4] : "none");
             return -1;
         }
         for (int i = 0; i < nrResults; ++i) {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/mapcode.git



More information about the Pkg-grass-devel mailing list