diff options
Diffstat (limited to 'src/is_tar.c')
| -rw-r--r-- | src/is_tar.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/is_tar.c b/src/is_tar.c index 1953a7fc102e..7110604f9e81 100644 --- a/src/is_tar.c +++ b/src/is_tar.c @@ -40,7 +40,7 @@ #include "file.h" #ifndef lint -FILE_RCSID("@(#)$File: is_tar.c,v 1.39 2017/03/17 20:45:01 christos Exp $") +FILE_RCSID("@(#)$File: is_tar.c,v 1.41 2017/11/02 20:25:39 christos Exp $") #endif #include "magic.h" @@ -53,15 +53,17 @@ FILE_RCSID("@(#)$File: is_tar.c,v 1.39 2017/03/17 20:45:01 christos Exp $") private int is_tar(const unsigned char *, size_t); private int from_oct(const char *, size_t); /* Decode octal number */ -static const char tartype[][32] = { - "tar archive", +static const char tartype[][32] = { /* should be equal to messages */ + "tar archive", /* found in ../magic/Magdir/archive */ "POSIX tar archive", - "POSIX tar archive (GNU)", + "POSIX tar archive (GNU)", /* */ }; protected int -file_is_tar(struct magic_set *ms, const unsigned char *buf, size_t nbytes) +file_is_tar(struct magic_set *ms, const struct buffer *b) { + const unsigned char *buf = b->fbuf; + size_t nbytes = b->flen; /* * Do the tar test first, because if the first file in the tar * archive starts with a dot, we can confuse it with an nroff file. |
