X-Git-Url: http://git.draconx.ca/gitweb/cdecl99.git/blobdiff_plain/1c3b0c0e6f9339e76e42f6393e554c7dfc58e205..00514ec7f1070550a52651971bb6a5e36efbe4f0:/t/crossparse.c diff --git a/t/crossparse.c b/t/crossparse.c index e19b438..4122b1c 100644 --- a/t/crossparse.c +++ b/t/crossparse.c @@ -1,6 +1,6 @@ /* * Test that libcdecl can parse its own output. - * Copyright © 2012, 2020 Nick Bowler + * Copyright © 2012, 2020, 2022-2023 Nick Bowler * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -45,8 +45,6 @@ static void print_usage(FILE *f) static void print_help(void) { - const struct option *opt; - print_usage(stdout); puts("Test that libcdecl can parse its own output.\n"); test_print_options(lopts); @@ -139,6 +137,7 @@ int main(int argc, char **argv) { int opt, mode = MODE_CDECL; int ret = EXIT_SUCCESS; + int i; const char *filename = NULL; FILE *infile = NULL; @@ -190,8 +189,11 @@ int main(int argc, char **argv) if (!test_crossparse(line, mode)) ret = EXIT_FAILURE; } + + free(line); + fclose(infile); } else if (argv[optind]) { - for (int i = optind; i < argc; i++) { + for (i = optind; i < argc; i++) { if (!test_crossparse(argv[i], mode)) ret = EXIT_FAILURE; }