From: Christos Zoulas Date: Thu, 20 Aug 2009 12:51:10 +0000 (+0000) Subject: undo NUL termination of apple, printing handles it. X-Git-Tag: FILE5_04~48 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5d86161431e8d126944a022905e4beede5f5843b;p=file undo NUL termination of apple, printing handles it. --- diff --git a/src/apprentice.c b/src/apprentice.c index 906bb18e..30da6c40 100644 --- a/src/apprentice.c +++ b/src/apprentice.c @@ -32,7 +32,7 @@ #include "file.h" #ifndef lint -FILE_RCSID("@(#)$File: apprentice.c,v 1.152 2009/05/08 17:41:58 christos Exp $") +FILE_RCSID("@(#)$File: apprentice.c,v 1.153 2009/08/19 19:54:37 christos Exp $") #endif /* lint */ #include "magic.h" @@ -1512,7 +1512,7 @@ parse_apple(struct magic_set *ms, struct magic_entry *me, const char *line) || strchr("-+/.", *l)) && i < sizeof(m->apple); m->apple[i++] = *l++) continue; if (i == sizeof(m->apple) && *l) { - m->apple[sizeof(m->apple) - 1] = '\0'; + /* We don't need to NUL terminate here, printing handles it */ if (ms->flags & MAGIC_CHECK) file_magwarn(ms, "APPLE type `%s' truncated %zu", line, i);