diff --git a/src/Makefile.am b/src/Makefile.am index 568af56..4750f03 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -4,7 +4,8 @@ sun_SOURCES = sun_main.c sun.c sun_LDADD = -lm if GEONAMES_SUPPORT - bin_PROGRAMS += geonames + TESTS = geonames + check_PROGRAMS = geonames geonames_SOURCES = geonames_main.c geonames.c geonames_LDADD = $(DEPS_GEONAMES_LIBS) diff --git a/src/sun_main.c b/src/sun_main.c index 792718c..872f117 100644 --- a/src/sun_main.c +++ b/src/sun_main.c @@ -140,7 +140,7 @@ int main(int argc, char *argv[]) { /* parse command line arguments */ while (1) { int optidx; - int c = getopt_long(argc-1, argv+1, "hvt:d:f:a:o:q:z:", long_options, &optidx); + int c = getopt_long(argc, argv, "hvt:d:f:a:o:q:z:", long_options, &optidx); /* detect the end of the options. */ if (c == -1) break;