]> granicus.if.org Git - file/commitdiff
Avoid printing a bad pointer from Charles Longeau
authorChristos Zoulas <christos@zoulas.com>
Sun, 18 May 2008 23:20:40 +0000 (23:20 +0000)
committerChristos Zoulas <christos@zoulas.com>
Sun, 18 May 2008 23:20:40 +0000 (23:20 +0000)
src/apprentice.c

index d35f148c365bb390f6b5f177146cb1d7d44ff11a..73935bcc53aa7605850c6250cd800c48c7671320 100644 (file)
@@ -49,7 +49,7 @@
 #include <dirent.h>
 
 #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;
        }