]> granicus.if.org Git - file/commitdiff
more lint fixes.
authorChristos Zoulas <christos@zoulas.com>
Sun, 31 Aug 2008 07:58:00 +0000 (07:58 +0000)
committerChristos Zoulas <christos@zoulas.com>
Sun, 31 Aug 2008 07:58:00 +0000 (07:58 +0000)
src/apprentice.c
src/apptype.c
src/ascmagic.c
src/readelf.c

index 3c94719184065e3a5ae1b291d63d46f982bc3b1e..be84f20f3904da21f280238436ab6c8c83c5dd4c 100644 (file)
@@ -49,7 +49,7 @@
 #include <dirent.h>
 
 #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:
index 89efe618c580dfadb40c9f8b8622156b2e5d54f3..ab776856b4901ead713e3accacd51afa2b82fd37 100644 (file)
  * 
  */
 
-#include "file.h"
-
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 
+#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__
index 63e71aec491c291b7a67b8020afff52f74dc3cb6..3bbd65243f890fd4a8210ab44fae4c35e8b9b353 100644 (file)
@@ -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;
        }
index 99cbf3f52924898992719afe5f3cddc8345b2582..811c29fded771ce0d4bf4dcf72eb84d7fd443a6c 100644 (file)
@@ -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) !=