From: Christos Zoulas Date: Sun, 31 Aug 2008 07:58:00 +0000 (+0000) Subject: more lint fixes. X-Git-Tag: FILE5_00~91 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c3ba8668bebb5f638a9b202920ca41ae48617c1c;p=file more lint fixes. --- diff --git a/src/apprentice.c b/src/apprentice.c index 3c947191..be84f20f 100644 --- a/src/apprentice.c +++ b/src/apprentice.c @@ -49,7 +49,7 @@ #include #ifndef lint -FILE_RCSID("@(#)$File: apprentice.c,v 1.139 2008/07/18 17:24:06 christos Exp $") +FILE_RCSID("@(#)$File: apprentice.c,v 1.140 2008/07/20 04:02:15 christos Exp $") #endif /* lint */ #define EATAB {while (isascii((unsigned char) *l) && \ @@ -589,7 +589,8 @@ set_test_type(struct magic *mstart, struct magic *m) case FILE_REGEX: case FILE_SEARCH: /* binary test if pattern is not text */ - if (file_looks_utf8(m->value.us, m->vallen, NULL, NULL) <= 0) + if (file_looks_utf8(m->value.us, (size_t)m->vallen, NULL, + NULL) <= 0) mstart->flag |= BINTEST; break; case FILE_DEFAULT: diff --git a/src/apptype.c b/src/apptype.c index 89efe618..ab776856 100644 --- a/src/apptype.c +++ b/src/apptype.c @@ -24,15 +24,14 @@ * */ -#include "file.h" - #include #include #include +#include "file.h" #ifndef lint -FILE_RCSID("@(#)$File: apptype.c,v 1.6 2003/11/11 20:01:45 christos Exp $") +FILE_RCSID("@(#)$File: apptype.c,v 1.7 2007/01/12 17:38:27 christos Exp $") #endif /* lint */ #ifdef __EMX__ diff --git a/src/ascmagic.c b/src/ascmagic.c index 63e71aec..3bbd6524 100644 --- a/src/ascmagic.c +++ b/src/ascmagic.c @@ -49,7 +49,7 @@ #include "names.h" #ifndef lint -FILE_RCSID("@(#)$File: ascmagic.c,v 1.63 2008/05/09 14:20:28 christos Exp $") +FILE_RCSID("@(#)$File: ascmagic.c,v 1.64 2008/07/16 18:00:57 christos Exp $") #endif /* lint */ #define MAXLINELEN 300 /* longest sane line length */ @@ -179,7 +179,8 @@ file_ascmagic(struct magic_set *ms, const unsigned char *buf, size_t nbytes) } if ((utf8_end = encode_utf8(utf8_buf, mlen, ubuf, ulen)) == NULL) goto done; - if (file_softmagic(ms, utf8_buf, utf8_end - utf8_buf, TEXTTEST) != 0) { + if (file_softmagic(ms, utf8_buf, (size_t)(utf8_end - utf8_buf), + TEXTTEST) != 0) { rv = 1; goto done; } diff --git a/src/readelf.c b/src/readelf.c index 99cbf3f5..811c29fd 100644 --- a/src/readelf.c +++ b/src/readelf.c @@ -38,7 +38,7 @@ #include "magic.h" #ifndef lint -FILE_RCSID("@(#)$File: readelf.c,v 1.76 2008/07/16 18:00:57 christos Exp $") +FILE_RCSID("@(#)$File: readelf.c,v 1.77 2008/08/30 17:51:09 christos Exp $") #endif #ifdef ELFCORE @@ -907,7 +907,8 @@ doshn(struct magic_set *ms, int clazz, int swap, int fd, off_t off, int num, for (;;) { Elf32_Cap cap32; Elf64_Cap cap64; - char cbuf[MAX(sizeof cap32, sizeof cap64)]; + char cbuf[/*CONSTCOND*/ + MAX(sizeof cap32, sizeof cap64)]; if ((coff += xcap_sizeof) >= (size_t)xsh_size) break; if (read(fd, cbuf, (size_t)xcap_sizeof) !=