]> granicus.if.org Git - file/commitdiff
Cast [f]printf to void to make lint happy.
authorReuben Thomas <rrt@sc3d.org>
Sat, 1 Mar 2008 11:49:07 +0000 (11:49 +0000)
committerReuben Thomas <rrt@sc3d.org>
Sat, 1 Mar 2008 11:49:07 +0000 (11:49 +0000)
tests/test.c

index ce3419e6b521d91392ec1b579931160b637bb4e8..db91c62f2ece3c892435fab9d5b4bbb9e598f994 100644 (file)
@@ -35,7 +35,7 @@ xrealloc(void *p, size_t n)
 {
        p = realloc(p, n);
        if (p == NULL) {
-               fprintf(stderr, "ERROR slurping file: out of memory\n");
+               (void)fprintf(stderr, "ERROR slurping file: out of memory\n");
                exit(10);
        }
        return p;
@@ -76,33 +76,33 @@ main(int argc, char **argv)
 
        ms = magic_open(MAGIC_NONE);
        if (ms == NULL) {
-               fprintf(stderr, "ERROR opening MAGIC_NONE: out of memory\n");
+               (void)fprintf(stderr, "ERROR opening MAGIC_NONE: out of memory\n");
                return 10;
        }
        if (magic_load(ms, NULL) == -1) {
-               fprintf(stderr, "ERROR loading with NULL file: %s\n", magic_error(ms));
+               (void)fprintf(stderr, "ERROR loading with NULL file: %s\n", magic_error(ms));
                return 11;
        }
 
        if (argc > 1) {
                if (argc != 3) {
-                       fprintf(stderr, "Usage: test TEST-FILE RESULT\n");
+                       (void)fprintf(stderr, "Usage: test TEST-FILE RESULT\n");
                } else {
                        if ((result = magic_file(ms, argv[1])) == NULL) {
-                               fprintf(stderr, "ERROR loading file %s: %s\n", argv[1], magic_error(ms));
+                               (void)fprintf(stderr, "ERROR loading file %s: %s\n", argv[1], magic_error(ms));
                                return 12;
                        } else {
                                fp = fopen(argv[2], "r");
                                if (fp == NULL) {
-                                       fprintf(stderr, "ERROR opening `%s': ", argv[2]);
+                                       (void)fprintf(stderr, "ERROR opening `%s': ", argv[2]);
                                        perror(NULL);
                                        return 13;
                                }
                                desired = slurp(fp, &desired_len);
                                fclose(fp);
-                               printf("%s: %s\n", argv[1], result);
+                               (void)printf("%s: %s\n", argv[1], result);
                                 if (strcmp(result, desired) != 0) {
-                                       fprintf(stderr, "Error: result was\n%s\nexpected:\n%s\n", result, desired);
+                                       (void)fprintf(stderr, "Error: result was\n%s\nexpected:\n%s\n", result, desired);
                                        return 1;
                                 }
                        }