summaryrefslogtreecommitdiffstats
path: root/contrib/file/compress.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/file/compress.c')
-rw-r--r--contrib/file/compress.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/contrib/file/compress.c b/contrib/file/compress.c
index 487b1b7..5867ac9 100644
--- a/contrib/file/compress.c
+++ b/contrib/file/compress.c
@@ -56,13 +56,13 @@
#ifndef lint
-FILE_RCSID("@(#)$File: compress.c,v 1.54 2007/12/02 00:28:10 christos Exp $")
+FILE_RCSID("@(#)$File: compress.c,v 1.57 2008/07/16 18:00:57 christos Exp $")
#endif
-private struct {
- const char *magic;
+private const struct {
+ const char magic[8];
size_t maglen;
- const char *const argv[3];
+ const char *argv[3];
int silent;
} compr[] = {
{ "\037\235", 2, { "gzip", "-cdq", NULL }, 1 }, /* compressed */
@@ -330,7 +330,7 @@ uncompressgzipped(struct magic_set *ms, const unsigned char *old,
if (data_start >= n)
return 0;
- if ((*newch = (unsigned char *)malloc(HOWMANY + 1)) == NULL) {
+ if ((*newch = CAST(unsigned char *, malloc(HOWMANY + 1))) == NULL) {
return 0;
}
@@ -374,6 +374,7 @@ uncompressbuf(struct magic_set *ms, int fd, size_t method,
int r;
#ifdef BUILTIN_DECOMPRESS
+ /* FIXME: This doesn't cope with bzip2 */
if (method == 2)
return uncompressgzipped(ms, old, newch, n);
#endif
OpenPOWER on IntegriCloud