diff options
author | David E. O'Brien <obrien@FreeBSD.org> | 2009-05-04 00:37:44 +0000 |
---|---|---|
committer | David E. O'Brien <obrien@FreeBSD.org> | 2009-05-04 00:37:44 +0000 |
commit | 7dbb948b5f00eabb81904e9db0aa9fc712939aca (patch) | |
tree | 12756817ab8bc4334652c625c7731c9e7fd0cefc /contrib/file/compress.c | |
parent | 8ee6f90a0c45383950152583c7fd62172e27bb73 (diff) | |
parent | 4f3dd34290f174adbda2b9668cc6b6c554ae9bb0 (diff) |
Merge vendor/file/dist@191739, bringing FILE 5.00 to 8-CURRENT.
Notes
Notes:
svn path=/head/; revision=191771
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 5867ac94a8f5..0a30803c40d9 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); |