]> git.draconx.ca Git - cdecl99.git/blobdiff - t/crossparse.c
tests: Add sanity check for truncated output.
[cdecl99.git] / t / crossparse.c
index e19b43852f77e6a28d984376f8e45b9e688cf989..630e02e05c0417e6b4cca4b224adef56cd3b826a 100644 (file)
@@ -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);
@@ -190,6 +188,9 @@ 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++) {
                        if (!test_crossparse(argv[i], mode))