summaryrefslogtreecommitdiff
path: root/src/print.c
diff options
context:
space:
mode:
authorChristos Zoulas <christos@zoulas.com>2022-09-27 01:58:20 +0000
committerChristos Zoulas <christos@zoulas.com>2022-09-27 01:58:20 +0000
commit5e0b425aeb0630241277f71a916897ca06e714a3 (patch)
tree57a34a3deadb044b89aeaaa276ce9d0be68bb469 /src/print.c
parent93ddf99bc1d4e3dd526d5ae5367c3b4c4800354f (diff)
downloadfile-git-5e0b425aeb0630241277f71a916897ca06e714a3.tar.gz
Avoid aborting on bad op on default (clusterfuxx)
Diffstat (limited to 'src/print.c')
-rw-r--r--src/print.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/print.c b/src/print.c
index bf1887e0..66d32d5e 100644
--- a/src/print.c
+++ b/src/print.c
@@ -32,7 +32,7 @@
#include "file.h"
#ifndef lint
-FILE_RCSID("@(#)$File: print.c,v 1.95 2022/09/24 20:30:13 christos Exp $")
+FILE_RCSID("@(#)$File: print.c,v 1.96 2022/09/27 01:58:20 christos Exp $")
#endif /* lint */
#include <string.h>
@@ -250,7 +250,7 @@ file_magwarn(struct magic_set *ms, const char *f, ...)
/* cuz we use stdout for most, stderr here */
(void) fflush(stdout);
- if (ms->file)
+ if (ms && ms->file)
(void) fprintf(stderr, "%s, %lu: ", ms->file,
CAST(unsigned long, ms->line));
(void) fprintf(stderr, "Warning: ");