From 3bbffe89bcd691d989c4b0015d54ed32b9f2cf9d Mon Sep 17 00:00:00 2001 From: Christos Zoulas Date: Sun, 18 May 2008 23:20:40 +0000 Subject: [PATCH] Avoid printing a bad pointer from Charles Longeau --- src/apprentice.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/apprentice.c b/src/apprentice.c index d35f148c..73935bcc 100644 --- a/src/apprentice.c +++ b/src/apprentice.c @@ -49,7 +49,7 @@ #include #ifndef lint -FILE_RCSID("@(#)$File: apprentice.c,v 1.135 2008/05/09 14:20:28 christos Exp $") +FILE_RCSID("@(#)$File: apprentice.c,v 1.136 2008/05/18 23:20:40 christos Exp $") #endif /* lint */ #define EATAB {while (isascii((unsigned char) *l) && \ @@ -1557,7 +1557,8 @@ check_format(struct magic_set *ms, struct magic *m) * string is not one character long */ file_magwarn(ms, "Printf format `%c' is not valid for type " - "`%s' in description `%s'", *ptr, + "`%s' in description `%s'", + ptr && *ptr ? *ptr : '?', file_names[m->type], m->desc); return -1; } -- 2.50.1