summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorReuben Thomas <rrt@sc3d.org>2008-03-01 11:49:07 +0000
committerReuben Thomas <rrt@sc3d.org>2008-03-01 11:49:07 +0000
commitff0b689706d0591ba7041b935f2753a2dc53fc31 (patch)
treed14e460720fb1fd4dd3228b5a326e2154ab25270 /tests
parent46912e7ca801d55d1a28b159b59893082c38bfa6 (diff)
downloadfile-git-ff0b689706d0591ba7041b935f2753a2dc53fc31.tar.gz
Cast [f]printf to void to make lint happy.
Diffstat (limited to 'tests')
-rw-r--r--tests/test.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/test.c b/tests/test.c
index ce3419e6..db91c62f 100644
--- a/tests/test.c
+++ b/tests/test.c
@@ -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;
}
}