Skip to content

Commit 3088aa3

Browse files
committed
Fixed error msg
1 parent 6ee39c4 commit 3088aa3

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

mapcode.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ static const double PI = 3.14159265358979323846;
1111

1212
static void usage(const char* appName) {
1313
printf("Usage: \n");
14-
printf(" %s [-d | --decode] <default-territory-ISO3> <mapcode> [<mapcode> ...]\n", appName);
14+
printf(" %s [-d | --decode] <default-territory> <mapcode> [<mapcode> ...]\n", appName);
1515
printf("\n");
1616
printf(" Decode a Mapcode to a lat/lon. The default territory code is used if\n");
1717
printf(" the Mapcode is a shorthand local code\n");
1818
printf("\n");
19-
printf(" %s [-e | --encode] <lat:-90..90> <lon:-180..180> [territory-ISO3]>\n", appName);
19+
printf(" %s [-e | --encode] <lat:-90..90> <lon:-180..180> [territory]>\n", appName);
2020
printf("\n");
2121
printf(" Encode a lat/lon to a Mapcode. If the territory code is specified, the\n");
2222
printf(" encoding will only succeeed if the lat/lon is located in the territory.\n");
@@ -50,7 +50,7 @@ int main(const int argc, const char** argv)
5050
if ((strcmp(cmd, "-d") == 0) || (strcmp(cmd, "--decode") == 0)) {
5151

5252
// ------------------------------------------------------------------
53-
// Decode: [-d | --decode] <default-territory-ISO3> <mapcode> [<mapcode> ...]
53+
// Decode: [-d | --decode] <default-territory> <mapcode> [<mapcode> ...]
5454
// ------------------------------------------------------------------
5555
if (argc < 4) {
5656
usage(appName);
@@ -64,7 +64,7 @@ int main(const int argc, const char** argv)
6464
for (int i = 3; i < argc; ++i) {
6565
int err = mc2coord(&lat, &lon, argv[i], context);
6666
if (err != 0) {
67-
printf("error: cannot decode '%s' (default territory='%s')\n", argv[i], argv[1]);
67+
printf("error: cannot decode '%s' (default territory='%s')\n", argv[i], argv[2]);
6868
return -1;
6969
}
7070
printf("%f %f\n", lat, lon);
@@ -73,7 +73,7 @@ int main(const int argc, const char** argv)
7373
else if ((strcmp(cmd, "-e") == 0) || (strcmp(cmd, "--encode") == 0)) {
7474

7575
// ------------------------------------------------------------------
76-
// Encode: [-e | --encode] <lat:-90..90> <lon:-180..180> [territory-ISO3]>
76+
// Encode: [-e | --encode] <lat:-90..90> <lon:-180..180> [territory]>
7777
// ------------------------------------------------------------------
7878
if ((argc != 4) && (argc != 5)) {
7979
usage(appName);

0 commit comments

Comments
 (0)