diff options
author | obrien <obrien@FreeBSD.org> | 2009-05-04 00:37:44 +0000 |
---|---|---|
committer | obrien <obrien@FreeBSD.org> | 2009-05-04 00:37:44 +0000 |
commit | a8abfd3eba1e14d222768ebf8316ec02e56af39a (patch) | |
tree | 12756817ab8bc4334652c625c7731c9e7fd0cefc /contrib/file/compress.c | |
parent | 3222e9c2cde262a2a5a46f45f0a1e06623f69433 (diff) | |
parent | 3d89d1fbe920995209cda59ff0fd5096b6471133 (diff) | |
download | FreeBSD-src-a8abfd3eba1e14d222768ebf8316ec02e56af39a.zip FreeBSD-src-a8abfd3eba1e14d222768ebf8316ec02e56af39a.tar.gz |
Merge vendor/file/dist@191739, bringing FILE 5.00 to 8-CURRENT.
Diffstat (limited to 'contrib/file/compress.c')
-rw-r--r-- | contrib/file/compress.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/contrib/file/compress.c b/contrib/file/compress.c index 5867ac9..0a30803 100644 --- a/contrib/file/compress.c +++ b/contrib/file/compress.c @@ -33,15 +33,18 @@ * using method, return sizeof new */ #include "file.h" + +#ifndef lint +FILE_RCSID("@(#)$File: compress.c,v 1.61 2009/02/03 20:27:51 christos Exp $") +#endif + #include "magic.h" -#include <stdio.h> #include <stdlib.h> #ifdef HAVE_UNISTD_H #include <unistd.h> #endif #include <string.h> #include <errno.h> -#include <sys/types.h> #include <sys/ioctl.h> #ifdef HAVE_SYS_WAIT_H #include <sys/wait.h> @@ -54,11 +57,6 @@ #include <zlib.h> #endif - -#ifndef lint -FILE_RCSID("@(#)$File: compress.c,v 1.57 2008/07/16 18:00:57 christos Exp $") -#endif - private const struct { const char magic[8]; size_t maglen; @@ -77,6 +75,7 @@ private const struct { { "PK\3\4", 4, { "gzip", "-cdq", NULL }, 1 }, /* pkzipped, */ /* ...only first file examined */ { "BZh", 3, { "bzip2", "-cd", NULL }, 1 }, /* bzip2-ed */ + { "LZIP", 4, { "lzip", "-cdq", NULL }, 1 }, }; private size_t ncompr = sizeof(compr) / sizeof(compr[0]); @@ -237,7 +236,7 @@ file_pipe2file(struct magic_set *ms, int fd, const void *startbuf, char buf[4096]; int r, tfd; - (void)strcpy(buf, "/tmp/file.XXXXXX"); + (void)strlcpy(buf, "/tmp/file.XXXXXX", sizeof buf); #ifndef HAVE_MKSTEMP { char *ptr = mktemp(buf); |