]> 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 63f5e0cee2604dd81699e93798a083bed30f378b..6457c8822be41fcf774a972c1c50bc11546eb01a 100644 (file)
@@ -49,7 +49,7 @@
 #include <dirent.h>
 
 #ifndef        lint
-FILE_RCSID("@(#)$File: apprentice.c,v 1.134 2008/04/29 01:11:39 christos Exp $")
+FILE_RCSID("@(#)$File: apprentice.c,v 1.135 2008/05/09 14:20:28 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;
        }