CVS commit: src/external/bsd/file/dist/src
Module Name:src Committed By: christos Date: Fri Apr 5 16:56:58 UTC 2024 Modified Files: src/external/bsd/file/dist/src: apprentice.c Log Message: break strength ties so that qsort is deterministic To generate a diff of this commit: cvs rdiff -u -r1.28 -r1.29 src/external/bsd/file/dist/src/apprentice.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/file/dist/src/apprentice.c diff -u src/external/bsd/file/dist/src/apprentice.c:1.28 src/external/bsd/file/dist/src/apprentice.c:1.29 --- src/external/bsd/file/dist/src/apprentice.c:1.28 Fri Aug 18 15:00:11 2023 +++ src/external/bsd/file/dist/src/apprentice.c Fri Apr 5 12:56:58 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: apprentice.c,v 1.28 2023/08/18 19:00:11 christos Exp $ */ +/* $NetBSD: apprentice.c,v 1.29 2024/04/05 16:56:58 christos Exp $ */ /* * Copyright (c) Ian F. Darwin 1986-1995. @@ -37,7 +37,7 @@ #if 0 FILE_RCSID("@(#)$File: apprentice.c,v 1.342 2023/07/17 14:38:35 christos Exp $") #else -__RCSID("$NetBSD: apprentice.c,v 1.28 2023/08/18 19:00:11 christos Exp $"); +__RCSID("$NetBSD: apprentice.c,v 1.29 2024/04/05 16:56:58 christos Exp $"); #endif #endif /* lint */ @@ -1141,8 +1141,12 @@ apprentice_sort(const void *a, const voi const struct magic_entry *mb = CAST(const struct magic_entry *, b); size_t sa = file_magic_strength(ma->mp, ma->cont_count); size_t sb = file_magic_strength(mb->mp, mb->cont_count); - if (sa == sb) - return 0; + if (sa == sb) { + int x = memcmp(ma->mp, mb->mp, sizeof(*ma->mp)); + if (x == 0) + abort(); + return x > 0 ? -1 : 1; + } else if (sa > sb) return -1; else
CVS commit: src/external/bsd/file/dist/src
Module Name:src Committed By: christos Date: Fri Apr 5 16:56:58 UTC 2024 Modified Files: src/external/bsd/file/dist/src: apprentice.c Log Message: break strength ties so that qsort is deterministic To generate a diff of this commit: cvs rdiff -u -r1.28 -r1.29 src/external/bsd/file/dist/src/apprentice.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/external/bsd/file/dist/src
Module Name:src Committed By: martin Date: Tue Dec 17 08:02:00 UTC 2019 Modified Files: src/external/bsd/file/dist/src: readelf.c Log Message: Cast an off_t to intmax_t and use %jd to printf it. To generate a diff of this commit: cvs rdiff -u -r1.22 -r1.23 src/external/bsd/file/dist/src/readelf.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/file/dist/src/readelf.c diff -u src/external/bsd/file/dist/src/readelf.c:1.22 src/external/bsd/file/dist/src/readelf.c:1.23 --- src/external/bsd/file/dist/src/readelf.c:1.22 Tue Dec 17 02:31:05 2019 +++ src/external/bsd/file/dist/src/readelf.c Tue Dec 17 08:02:00 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: readelf.c,v 1.22 2019/12/17 02:31:05 christos Exp $ */ +/* $NetBSD: readelf.c,v 1.23 2019/12/17 08:02:00 martin Exp $ */ /* * Copyright (c) Christos Zoulas 2003. @@ -32,7 +32,7 @@ #if 0 FILE_RCSID("@(#)$File: readelf.c,v 1.168 2019/12/16 03:49:19 christos Exp $") #else -__RCSID("$NetBSD: readelf.c,v 1.22 2019/12/17 02:31:05 christos Exp $"); +__RCSID("$NetBSD: readelf.c,v 1.23 2019/12/17 08:02:00 martin Exp $"); #endif #endif @@ -1355,8 +1355,8 @@ doshn(struct magic_set *ms, int clazz, i name_off = xsh_offset; if (fsize != SIZE_UNKNOWN && fsize < name_off) { - if (file_printf(ms, ", too large section header offset %td", - name_off) == -1) + if (file_printf(ms, ", too large section header offset %jd", + (intmax_t)name_off) == -1) return -1; return 0; }
CVS commit: src/external/bsd/file/dist/src
Module Name:src Committed By: martin Date: Tue Dec 17 08:02:00 UTC 2019 Modified Files: src/external/bsd/file/dist/src: readelf.c Log Message: Cast an off_t to intmax_t and use %jd to printf it. To generate a diff of this commit: cvs rdiff -u -r1.22 -r1.23 src/external/bsd/file/dist/src/readelf.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/external/bsd/file/dist/src
Module Name:src Committed By: christos Date: Fri Oct 19 00:32:47 UTC 2018 Modified Files: src/external/bsd/file/dist/src: file.h readelf.c softmagic.c Log Message: fix lint fixes To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.22 src/external/bsd/file/dist/src/file.h cvs rdiff -u -r1.19 -r1.20 src/external/bsd/file/dist/src/readelf.c cvs rdiff -u -r1.20 -r1.21 src/external/bsd/file/dist/src/softmagic.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/file/dist/src/file.h diff -u src/external/bsd/file/dist/src/file.h:1.21 src/external/bsd/file/dist/src/file.h:1.22 --- src/external/bsd/file/dist/src/file.h:1.21 Thu Oct 18 20:24:57 2018 +++ src/external/bsd/file/dist/src/file.h Thu Oct 18 20:32:47 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: file.h,v 1.21 2018/10/19 00:24:57 christos Exp $ */ +/* $NetBSD: file.h,v 1.22 2018/10/19 00:32:47 christos Exp $ */ /* * Copyright (c) Ian F. Darwin 1986-1995. @@ -384,7 +384,7 @@ struct mlist { #define CCAST(T, b) const_cast(b) #else #define CAST(T, b) ((T)(b)) -#define RCAST(T, b) ((T)(void *)(b)) +#define RCAST(T, b) ((T)(uintptr_t)(b)) #define CCAST(T, b) ((T)(uintptr_t)(b)) #endif Index: src/external/bsd/file/dist/src/readelf.c diff -u src/external/bsd/file/dist/src/readelf.c:1.19 src/external/bsd/file/dist/src/readelf.c:1.20 --- src/external/bsd/file/dist/src/readelf.c:1.19 Thu Oct 18 20:24:57 2018 +++ src/external/bsd/file/dist/src/readelf.c Thu Oct 18 20:32:47 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: readelf.c,v 1.19 2018/10/19 00:24:57 christos Exp $ */ +/* $NetBSD: readelf.c,v 1.20 2018/10/19 00:32:47 christos Exp $ */ /* * Copyright (c) Christos Zoulas 2003. @@ -32,7 +32,7 @@ #if 0 FILE_RCSID("@(#)$File: readelf.c,v 1.154 2018/10/15 16:29:16 christos Exp $") #else -__RCSID("$NetBSD: readelf.c,v 1.19 2018/10/19 00:24:57 christos Exp $"); +__RCSID("$NetBSD: readelf.c,v 1.20 2018/10/19 00:32:47 christos Exp $"); #endif #endif @@ -792,7 +792,7 @@ do_core_note(struct magic_set *ms, unsig pidoff = argoff + 81 + 2; if (doff + pidoff + 4 <= size) { if (file_printf(ms, ", pid=%u", -elf_getu32(swap, *RCAST(uint32 *, (nbuf + +elf_getu32(swap, *RCAST(uint32_t *, (nbuf + doff + pidoff == -1) return 1; } Index: src/external/bsd/file/dist/src/softmagic.c diff -u src/external/bsd/file/dist/src/softmagic.c:1.20 src/external/bsd/file/dist/src/softmagic.c:1.21 --- src/external/bsd/file/dist/src/softmagic.c:1.20 Thu Oct 18 20:11:48 2018 +++ src/external/bsd/file/dist/src/softmagic.c Thu Oct 18 20:32:47 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: softmagic.c,v 1.20 2018/10/19 00:11:48 christos Exp $ */ +/* $NetBSD: softmagic.c,v 1.21 2018/10/19 00:32:47 christos Exp $ */ /* * Copyright (c) Ian F. Darwin 1986-1995. @@ -37,7 +37,7 @@ #if 0 FILE_RCSID("@(#)$File: softmagic.c,v 1.271 2018/10/15 16:29:16 christos Exp $") #else -__RCSID("$NetBSD: softmagic.c,v 1.20 2018/10/19 00:11:48 christos Exp $"); +__RCSID("$NetBSD: softmagic.c,v 1.21 2018/10/19 00:32:47 christos Exp $"); #endif #endif /* lint */ @@ -1441,7 +1441,7 @@ msetoffset(struct magic_set *ms, struct if ((size_t)-m->offset > b->elen) return -1; buffer_init(bb, -1, b->ebuf, b->elen); - ms->eoffset = ms->offset = b->elen + m->offset; + ms->eoffset = ms->offset = (int32_t)(b->elen + m->offset); } else { if (cont_level == 0) { normal:
CVS commit: src/external/bsd/file/dist/src
Module Name:src Committed By: christos Date: Fri Oct 19 00:32:47 UTC 2018 Modified Files: src/external/bsd/file/dist/src: file.h readelf.c softmagic.c Log Message: fix lint fixes To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.22 src/external/bsd/file/dist/src/file.h cvs rdiff -u -r1.19 -r1.20 src/external/bsd/file/dist/src/readelf.c cvs rdiff -u -r1.20 -r1.21 src/external/bsd/file/dist/src/softmagic.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/external/bsd/file/dist/src
Module Name:src Committed By: christos Date: Fri Oct 19 00:24:57 UTC 2018 Modified Files: src/external/bsd/file/dist/src: apprentice.c compress.c file.h is_json.c readelf.c Log Message: lint fixes To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.22 src/external/bsd/file/dist/src/apprentice.c cvs rdiff -u -r1.16 -r1.17 src/external/bsd/file/dist/src/compress.c cvs rdiff -u -r1.20 -r1.21 src/external/bsd/file/dist/src/file.h cvs rdiff -u -r1.1.1.1 -r1.2 src/external/bsd/file/dist/src/is_json.c cvs rdiff -u -r1.18 -r1.19 src/external/bsd/file/dist/src/readelf.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/external/bsd/file/dist/src
Module Name:src Committed By: christos Date: Fri Oct 19 00:24:57 UTC 2018 Modified Files: src/external/bsd/file/dist/src: apprentice.c compress.c file.h is_json.c readelf.c Log Message: lint fixes To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.22 src/external/bsd/file/dist/src/apprentice.c cvs rdiff -u -r1.16 -r1.17 src/external/bsd/file/dist/src/compress.c cvs rdiff -u -r1.20 -r1.21 src/external/bsd/file/dist/src/file.h cvs rdiff -u -r1.1.1.1 -r1.2 src/external/bsd/file/dist/src/is_json.c cvs rdiff -u -r1.18 -r1.19 src/external/bsd/file/dist/src/readelf.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/file/dist/src/apprentice.c diff -u src/external/bsd/file/dist/src/apprentice.c:1.21 src/external/bsd/file/dist/src/apprentice.c:1.22 --- src/external/bsd/file/dist/src/apprentice.c:1.21 Thu Oct 18 20:11:48 2018 +++ src/external/bsd/file/dist/src/apprentice.c Thu Oct 18 20:24:57 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: apprentice.c,v 1.21 2018/10/19 00:11:48 christos Exp $ */ +/* $NetBSD: apprentice.c,v 1.22 2018/10/19 00:24:57 christos Exp $ */ /* * Copyright (c) Ian F. Darwin 1986-1995. @@ -37,7 +37,7 @@ #if 0 FILE_RCSID("@(#)$File: apprentice.c,v 1.281 2018/10/10 17:41:10 christos Exp $") #else -__RCSID("$NetBSD: apprentice.c,v 1.21 2018/10/19 00:11:48 christos Exp $"); +__RCSID("$NetBSD: apprentice.c,v 1.22 2018/10/19 00:24:57 christos Exp $"); #endif #endif /* lint */ @@ -299,9 +299,9 @@ get_type(const struct type_tbl_s *tbl, c private off_t maxoff_t(void) { - if (sizeof(off_t) == sizeof(int)) + if (/*CONSTCOND*/sizeof(off_t) == sizeof(int)) return CAST(off_t, INT_MAX); - if (sizeof(off_t) == sizeof(long)) + if (/*CONSTCOND*/sizeof(off_t) == sizeof(long)) return CAST(off_t, LONG_MAX); return 0x7fff; } Index: src/external/bsd/file/dist/src/compress.c diff -u src/external/bsd/file/dist/src/compress.c:1.16 src/external/bsd/file/dist/src/compress.c:1.17 --- src/external/bsd/file/dist/src/compress.c:1.16 Thu Oct 18 20:11:48 2018 +++ src/external/bsd/file/dist/src/compress.c Thu Oct 18 20:24:57 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: compress.c,v 1.16 2018/10/19 00:11:48 christos Exp $ */ +/* $NetBSD: compress.c,v 1.17 2018/10/19 00:24:57 christos Exp $ */ /* * Copyright (c) Ian F. Darwin 1986-1995. @@ -40,7 +40,7 @@ #if 0 FILE_RCSID("@(#)$File: compress.c,v 1.113 2018/10/15 16:29:16 christos Exp $") #else -__RCSID("$NetBSD: compress.c,v 1.16 2018/10/19 00:11:48 christos Exp $"); +__RCSID("$NetBSD: compress.c,v 1.17 2018/10/19 00:24:57 christos Exp $"); #endif #endif @@ -428,7 +428,7 @@ file_pipe2file(struct magic_set *ms, int #else { int te; - int ou = umask(0); + mode_t ou = umask(0); tfd = mkstemp(buf); (void)umask(ou); te = errno; Index: src/external/bsd/file/dist/src/file.h diff -u src/external/bsd/file/dist/src/file.h:1.20 src/external/bsd/file/dist/src/file.h:1.21 --- src/external/bsd/file/dist/src/file.h:1.20 Thu Oct 18 20:11:48 2018 +++ src/external/bsd/file/dist/src/file.h Thu Oct 18 20:24:57 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: file.h,v 1.20 2018/10/19 00:11:48 christos Exp $ */ +/* $NetBSD: file.h,v 1.21 2018/10/19 00:24:57 christos Exp $ */ /* * Copyright (c) Ian F. Darwin 1986-1995. @@ -384,7 +384,7 @@ struct mlist { #define CCAST(T, b) const_cast(b) #else #define CAST(T, b) ((T)(b)) -#define RCAST(T, b) ((T)(b)) +#define RCAST(T, b) ((T)(void *)(b)) #define CCAST(T, b) ((T)(uintptr_t)(b)) #endif Index: src/external/bsd/file/dist/src/is_json.c diff -u src/external/bsd/file/dist/src/is_json.c:1.1.1.1 src/external/bsd/file/dist/src/is_json.c:1.2 --- src/external/bsd/file/dist/src/is_json.c:1.1.1.1 Thu Oct 18 19:54:09 2018 +++ src/external/bsd/file/dist/src/is_json.c Thu Oct 18 20:24:57 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: is_json.c,v 1.1.1.1 2018/10/18 23:54:09 christos Exp $ */ +/* $NetBSD: is_json.c,v 1.2 2018/10/19 00:24:57 christos Exp $ */ /*- * Copyright (c) 2018 Christos Zoulas @@ -37,7 +37,7 @@ #if 0 FILE_RCSID("@(#)$File: is_json.c,v 1.11 2018/10/15 16:29:16 christos Exp $") #else -__RCSID("$NetBSD: is_json.c,v 1.1.1.1 2018/10/18 23:54:09 christos Exp $"); +__RCSID("$NetBSD: is_json.c,v 1.2 2018/10/19 00:24:57 christos Exp $"); #endif #endif @@ -50,7 +50,7 @@ __RCSID("$NetBSD: is_json.c,v 1.1.1.1 20 #define DPRINTF(a, b, c) \ printf("%s [%.2x/%c] %.20s\n", (a), *(b), *(b), (const char *)(c)) #else -#define DPRINTF(a, b, c) (void)0 +#define DPRINTF(a, b, c) do { } while (/*CONSTCOND*/0) #endif #define JSON_ARRAY 0 Index: src/external/bsd/file/dist/src/readelf.c diff -u src/external/bsd/file/dist/src/readelf.c:1.18 src/external/bsd/file/dist/src/readelf.c:1.19 --- src/external/bsd/file/dist/src/readelf.c:1.18 Thu Oct 18 20:11:48 2018 +++ src/external/bsd/file/dist/src/readelf.c Thu Oct 18 20:24:57 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: readelf.c,v 1.18 2018/10/19
CVS commit: src/external/bsd/file/dist/src
Module Name:src Committed By: christos Date: Wed Apr 18 01:18:16 UTC 2018 Modified Files: src/external/bsd/file/dist/src: file.c Log Message: __noreturn__ does in the header. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/external/bsd/file/dist/src/file.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/file/dist/src/file.c diff -u src/external/bsd/file/dist/src/file.c:1.10 src/external/bsd/file/dist/src/file.c:1.11 --- src/external/bsd/file/dist/src/file.c:1.10 Tue Apr 17 08:34:04 2018 +++ src/external/bsd/file/dist/src/file.c Tue Apr 17 21:18:16 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: file.c,v 1.10 2018/04/17 12:34:04 jakllsch Exp $ */ +/* $NetBSD: file.c,v 1.11 2018/04/18 01:18:16 christos Exp $ */ /* * Copyright (c) Ian F. Darwin 1986-1995. @@ -37,7 +37,7 @@ #if 0 FILE_RCSID("@(#)$File: file.c,v 1.175 2018/03/02 16:11:37 christos Exp $") #else -__RCSID("$NetBSD: file.c,v 1.10 2018/04/17 12:34:04 jakllsch Exp $"); +__RCSID("$NetBSD: file.c,v 1.11 2018/04/18 01:18:16 christos Exp $"); #endif #endif /* lint */ @@ -677,9 +677,6 @@ file_getprogname(void) return file_progname; } -#ifdef __dead -__dead -#endif protected void file_err(int e, const char *fmt, ...) { @@ -694,9 +691,6 @@ file_err(int e, const char *fmt, ...) exit(e); } -#ifdef __dead -__dead -#endif protected void file_errx(int e, const char *fmt, ...) {
CVS commit: src/external/bsd/file/dist/src
Module Name:src Committed By: christos Date: Wed Apr 18 01:18:16 UTC 2018 Modified Files: src/external/bsd/file/dist/src: file.c Log Message: __noreturn__ does in the header. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/external/bsd/file/dist/src/file.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/external/bsd/file/dist/src
Module Name:src Committed By: christos Date: Wed Apr 18 01:17:42 UTC 2018 Modified Files: src/external/bsd/file/dist/src: file.h Log Message: add __noreturn__ attribute to file_err{,x} To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/external/bsd/file/dist/src/file.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/file/dist/src/file.h diff -u src/external/bsd/file/dist/src/file.h:1.18 src/external/bsd/file/dist/src/file.h:1.19 --- src/external/bsd/file/dist/src/file.h:1.18 Sun Apr 15 15:45:32 2018 +++ src/external/bsd/file/dist/src/file.h Tue Apr 17 21:17:42 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: file.h,v 1.18 2018/04/15 19:45:32 christos Exp $ */ +/* $NetBSD: file.h,v 1.19 2018/04/18 01:17:42 christos Exp $ */ /* * Copyright (c) Ian F. Darwin 1986-1995. @@ -620,9 +620,9 @@ int enable_sandbox_full(void); protected const char *file_getprogname(void); protected void file_setprogname(const char *); protected void file_err(int, const char *, ...) -__attribute__((__format__(__printf__, 2, 3))); +__attribute__((__format__(__printf__, 2, 3), __noreturn__)); protected void file_errx(int, const char *, ...) -__attribute__((__format__(__printf__, 2, 3))); +__attribute__((__format__(__printf__, 2, 3), __noreturn__)); protected void file_warn(const char *, ...) __attribute__((__format__(__printf__, 1, 2))); protected void file_warnx(const char *, ...)
CVS commit: src/external/bsd/file/dist/src
Module Name:src Committed By: christos Date: Wed Apr 18 01:17:42 UTC 2018 Modified Files: src/external/bsd/file/dist/src: file.h Log Message: add __noreturn__ attribute to file_err{,x} To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/external/bsd/file/dist/src/file.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/external/bsd/file/dist/src
Module Name:src Committed By: jakllsch Date: Tue Apr 17 12:34:04 UTC 2018 Modified Files: src/external/bsd/file/dist/src: file.c Log Message: sprinkle #ifdef __dead \n __dead \n #endif for clang To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/external/bsd/file/dist/src/file.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/file/dist/src/file.c diff -u src/external/bsd/file/dist/src/file.c:1.9 src/external/bsd/file/dist/src/file.c:1.10 --- src/external/bsd/file/dist/src/file.c:1.9 Sun Apr 15 19:45:32 2018 +++ src/external/bsd/file/dist/src/file.c Tue Apr 17 12:34:04 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: file.c,v 1.9 2018/04/15 19:45:32 christos Exp $ */ +/* $NetBSD: file.c,v 1.10 2018/04/17 12:34:04 jakllsch Exp $ */ /* * Copyright (c) Ian F. Darwin 1986-1995. @@ -37,7 +37,7 @@ #if 0 FILE_RCSID("@(#)$File: file.c,v 1.175 2018/03/02 16:11:37 christos Exp $") #else -__RCSID("$NetBSD: file.c,v 1.9 2018/04/15 19:45:32 christos Exp $"); +__RCSID("$NetBSD: file.c,v 1.10 2018/04/17 12:34:04 jakllsch Exp $"); #endif #endif /* lint */ @@ -677,6 +677,9 @@ file_getprogname(void) return file_progname; } +#ifdef __dead +__dead +#endif protected void file_err(int e, const char *fmt, ...) { @@ -691,6 +694,9 @@ file_err(int e, const char *fmt, ...) exit(e); } +#ifdef __dead +__dead +#endif protected void file_errx(int e, const char *fmt, ...) {
CVS commit: src/external/bsd/file/dist/src
Module Name:src Committed By: jakllsch Date: Tue Apr 17 12:34:04 UTC 2018 Modified Files: src/external/bsd/file/dist/src: file.c Log Message: sprinkle #ifdef __dead \n __dead \n #endif for clang To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/external/bsd/file/dist/src/file.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/external/bsd/file/dist/src
Module Name:src Committed By: christos Date: Mon Dec 11 23:19:38 UTC 2017 Modified Files: src/external/bsd/file/dist/src: softmagic.c Log Message: If we don't have any formatting characters, we are always ok. To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 src/external/bsd/file/dist/src/softmagic.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/file/dist/src/softmagic.c diff -u src/external/bsd/file/dist/src/softmagic.c:1.17 src/external/bsd/file/dist/src/softmagic.c:1.18 --- src/external/bsd/file/dist/src/softmagic.c:1.17 Fri Sep 8 09:40:25 2017 +++ src/external/bsd/file/dist/src/softmagic.c Mon Dec 11 18:19:38 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: softmagic.c,v 1.17 2017/09/08 13:40:25 christos Exp $ */ +/* $NetBSD: softmagic.c,v 1.18 2017/12/11 23:19:38 christos Exp $ */ /* * Copyright (c) Ian F. Darwin 1986-1995. @@ -37,7 +37,7 @@ #if 0 FILE_RCSID("@(#)$File: softmagic.c,v 1.249 2017/06/19 18:30:25 christos Exp $") #else -__RCSID("$NetBSD: softmagic.c,v 1.17 2017/09/08 13:40:25 christos Exp $"); +__RCSID("$NetBSD: softmagic.c,v 1.18 2017/12/11 23:19:38 christos Exp $"); #endif #endif /* lint */ @@ -127,6 +127,8 @@ private const char * __attribute__((__fo file_fmtcheck(struct magic_set *ms, const struct magic *m, const char *def, const char *file, size_t line) { + if (strchr(m->desc, '%') == NULL) + return m->desc; const char *ptr = fmtcheck(m->desc, def); if (ptr == def) file_magerror(ms,
CVS commit: src/external/bsd/file/dist/src
Module Name:src Committed By: christos Date: Mon Dec 11 23:19:38 UTC 2017 Modified Files: src/external/bsd/file/dist/src: softmagic.c Log Message: If we don't have any formatting characters, we are always ok. To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 src/external/bsd/file/dist/src/softmagic.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/external/bsd/file/dist/src
Module Name:src Committed By: christos Date: Fri Feb 17 17:33:00 UTC 2017 Modified Files: src/external/bsd/file/dist/src: apprentice.c Log Message: Ignore files that start with . To generate a diff of this commit: cvs rdiff -u -r1.16 -r1.17 src/external/bsd/file/dist/src/apprentice.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/external/bsd/file/dist/src
Module Name:src Committed By: christos Date: Fri Feb 17 17:33:00 UTC 2017 Modified Files: src/external/bsd/file/dist/src: apprentice.c Log Message: Ignore files that start with . To generate a diff of this commit: cvs rdiff -u -r1.16 -r1.17 src/external/bsd/file/dist/src/apprentice.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/file/dist/src/apprentice.c diff -u src/external/bsd/file/dist/src/apprentice.c:1.16 src/external/bsd/file/dist/src/apprentice.c:1.17 --- src/external/bsd/file/dist/src/apprentice.c:1.16 Fri Feb 10 13:06:59 2017 +++ src/external/bsd/file/dist/src/apprentice.c Fri Feb 17 12:33:00 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: apprentice.c,v 1.16 2017/02/10 18:06:59 christos Exp $ */ +/* $NetBSD: apprentice.c,v 1.17 2017/02/17 17:33:00 christos Exp $ */ /* * Copyright (c) Ian F. Darwin 1986-1995. @@ -37,7 +37,7 @@ #if 0 FILE_RCSID("@(#)$File: apprentice.c,v 1.257 2017/02/04 16:46:16 christos Exp $") #else -__RCSID("$NetBSD: apprentice.c,v 1.16 2017/02/10 18:06:59 christos Exp $"); +__RCSID("$NetBSD: apprentice.c,v 1.17 2017/02/17 17:33:00 christos Exp $"); #endif #endif /* lint */ @@ -1322,6 +1322,8 @@ apprentice_load(struct magic_set *ms, co goto out; } while ((d = readdir(dir)) != NULL) { + if (d->d_name[0] == '.') +continue; if (asprintf(, "%s/%s", fn, d->d_name) < 0) { file_oomem(ms, strlen(fn) + strlen(d->d_name) + 2);
CVS commit: src/external/bsd/file/dist/src
Module Name:src Committed By: christos Date: Sat Feb 11 18:17:29 UTC 2017 Modified Files: src/external/bsd/file/dist/src: readelf.c Log Message: fix reversed logic To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/external/bsd/file/dist/src/readelf.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/external/bsd/file/dist/src
Module Name:src Committed By: christos Date: Sat Feb 11 18:17:29 UTC 2017 Modified Files: src/external/bsd/file/dist/src: readelf.c Log Message: fix reversed logic To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/external/bsd/file/dist/src/readelf.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/file/dist/src/readelf.c diff -u src/external/bsd/file/dist/src/readelf.c:1.13 src/external/bsd/file/dist/src/readelf.c:1.14 --- src/external/bsd/file/dist/src/readelf.c:1.13 Fri Feb 10 13:06:59 2017 +++ src/external/bsd/file/dist/src/readelf.c Sat Feb 11 13:17:29 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: readelf.c,v 1.13 2017/02/10 18:06:59 christos Exp $ */ +/* $NetBSD: readelf.c,v 1.14 2017/02/11 18:17:29 christos Exp $ */ /* * Copyright (c) Christos Zoulas 2003. @@ -32,7 +32,7 @@ #if 0 FILE_RCSID("@(#)$File: readelf.c,v 1.130 2017/01/29 19:34:24 christos Exp $") #else -__RCSID("$NetBSD: readelf.c,v 1.13 2017/02/10 18:06:59 christos Exp $"); +__RCSID("$NetBSD: readelf.c,v 1.14 2017/02/11 18:17:29 christos Exp $"); #endif #endif @@ -1191,7 +1191,7 @@ doshn(struct magic_set *ms, int clazz, i { Elf32_Shdr sh32; Elf64_Shdr sh64; - int stripped = 1, has_debug_info = 1; + int stripped = 1, has_debug_info = 0; size_t nbadcap = 0; void *nbuf; off_t noff, coff, name_off;
CVS commit: src/external/bsd/file/dist/src
Module Name:src Committed By: christos Date: Fri Feb 10 18:06:59 UTC 2017 Modified Files: src/external/bsd/file/dist/src: apprentice.c cdf.c compress.c print.c readelf.c softmagic.c Log Message: pacify lint. To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/external/bsd/file/dist/src/apprentice.c cvs rdiff -u -r1.12 -r1.13 src/external/bsd/file/dist/src/cdf.c \ src/external/bsd/file/dist/src/readelf.c cvs rdiff -u -r1.11 -r1.12 src/external/bsd/file/dist/src/compress.c cvs rdiff -u -r1.9 -r1.10 src/external/bsd/file/dist/src/print.c cvs rdiff -u -r1.14 -r1.15 src/external/bsd/file/dist/src/softmagic.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/file/dist/src/apprentice.c diff -u src/external/bsd/file/dist/src/apprentice.c:1.15 src/external/bsd/file/dist/src/apprentice.c:1.16 --- src/external/bsd/file/dist/src/apprentice.c:1.15 Fri Feb 10 12:53:24 2017 +++ src/external/bsd/file/dist/src/apprentice.c Fri Feb 10 13:06:59 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: apprentice.c,v 1.15 2017/02/10 17:53:24 christos Exp $ */ +/* $NetBSD: apprentice.c,v 1.16 2017/02/10 18:06:59 christos Exp $ */ /* * Copyright (c) Ian F. Darwin 1986-1995. @@ -37,7 +37,7 @@ #if 0 FILE_RCSID("@(#)$File: apprentice.c,v 1.257 2017/02/04 16:46:16 christos Exp $") #else -__RCSID("$NetBSD: apprentice.c,v 1.15 2017/02/10 17:53:24 christos Exp $"); +__RCSID("$NetBSD: apprentice.c,v 1.16 2017/02/10 18:06:59 christos Exp $"); #endif #endif /* lint */ @@ -555,8 +555,10 @@ apprentice_unmap(struct magic_map *map) break; case MAP_TYPE_MALLOC: for (i = 0; i < MAGIC_SETS; i++) { - if ((char *)map->magic[i] >= (char *)map->p && - (char *)map->magic[i] <= (char *)map->p + map->len) + void *b = map->magic[i]; + void *p = map->p; + if (CAST(char *, b) >= CAST(char *, p) && + CAST(char *, b) <= CAST(char *, p) + map->len) continue; free(map->magic[i]); } Index: src/external/bsd/file/dist/src/cdf.c diff -u src/external/bsd/file/dist/src/cdf.c:1.12 src/external/bsd/file/dist/src/cdf.c:1.13 --- src/external/bsd/file/dist/src/cdf.c:1.12 Fri Feb 10 12:53:24 2017 +++ src/external/bsd/file/dist/src/cdf.c Fri Feb 10 13:06:59 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: cdf.c,v 1.12 2017/02/10 17:53:24 christos Exp $ */ +/* $NetBSD: cdf.c,v 1.13 2017/02/10 18:06:59 christos Exp $ */ /*- * Copyright (c) 2008 Christos Zoulas @@ -40,7 +40,7 @@ #if 0 FILE_RCSID("@(#)$File: cdf.c,v 1.88 2017/02/07 23:21:29 christos Exp $") #else -__RCSID("$NetBSD: cdf.c,v 1.12 2017/02/10 17:53:24 christos Exp $"); +__RCSID("$NetBSD: cdf.c,v 1.13 2017/02/10 18:06:59 christos Exp $"); #endif #endif @@ -817,7 +817,7 @@ cdf_find_stream(const cdf_dir_t *dir, co == 0) break; if (i > 0) - return i; + return CAST(int, i); DPRINTF(("Cannot find type %d `%s'\n", type, name)); errno = ESRCH; @@ -1074,7 +1074,7 @@ cdf_unpack_catalog(const cdf_header_t *h { size_t ss = cdf_check_stream(sst, h); const char *b = CAST(const char *, sst->sst_tab); - const char *eb = b + ss * sst->sst_len; + const char *nb, *eb = b + ss * sst->sst_len; size_t nr, i, j, k; cdf_catalog_entry_t *ce; uint16_t reclen; @@ -1119,7 +1119,9 @@ cdf_unpack_catalog(const cdf_header_t *h cep->ce_namlen = rlen; np = CAST(const uint16_t *, CAST(const void *, (b + 16))); - if (RCAST(const char *, np + cep->ce_namlen) > eb) { + nb = CAST(const char *, CAST(const void *, + (np + cep->ce_namlen))); + if (nb > eb) { cep->ce_namlen = 0; break; } Index: src/external/bsd/file/dist/src/readelf.c diff -u src/external/bsd/file/dist/src/readelf.c:1.12 src/external/bsd/file/dist/src/readelf.c:1.13 --- src/external/bsd/file/dist/src/readelf.c:1.12 Fri Feb 10 12:53:24 2017 +++ src/external/bsd/file/dist/src/readelf.c Fri Feb 10 13:06:59 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: readelf.c,v 1.12 2017/02/10 17:53:24 christos Exp $ */ +/* $NetBSD: readelf.c,v 1.13 2017/02/10 18:06:59 christos Exp $ */ /* * Copyright (c) Christos Zoulas 2003. @@ -32,7 +32,7 @@ #if 0 FILE_RCSID("@(#)$File: readelf.c,v 1.130 2017/01/29 19:34:24 christos Exp $") #else -__RCSID("$NetBSD: readelf.c,v 1.12 2017/02/10 17:53:24 christos Exp $"); +__RCSID("$NetBSD: readelf.c,v 1.13 2017/02/10 18:06:59 christos Exp $"); #endif #endif @@ -896,7 +896,7 @@ get_string_on_virtaddr(struct magic_set offset = get_offset_from_virtaddr(ms, swap, clazz, fd, ph_off, ph_num, fsize, virtaddr); - if ((buflen = pread(fd, buf, buflen, offset)) <= 0) { + if ((buflen = pread(fd, buf, CAST(size_t, buflen), offset)) <= 0) { file_badread(ms); return 0; } Index: src/external/bsd/file/dist/src/compress.c diff -u src/external/bsd/file/dist/src/compress.c:1.11 src/external/bsd/file/dist/src/compress.c:1.12 --- src/external/bsd/file/dist/src/compress.c:1.11 Fri Feb 10 12:53:24 2017 +++
CVS commit: src/external/bsd/file/dist/src
Module Name:src Committed By: christos Date: Fri Feb 10 18:06:59 UTC 2017 Modified Files: src/external/bsd/file/dist/src: apprentice.c cdf.c compress.c print.c readelf.c softmagic.c Log Message: pacify lint. To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/external/bsd/file/dist/src/apprentice.c cvs rdiff -u -r1.12 -r1.13 src/external/bsd/file/dist/src/cdf.c \ src/external/bsd/file/dist/src/readelf.c cvs rdiff -u -r1.11 -r1.12 src/external/bsd/file/dist/src/compress.c cvs rdiff -u -r1.9 -r1.10 src/external/bsd/file/dist/src/print.c cvs rdiff -u -r1.14 -r1.15 src/external/bsd/file/dist/src/softmagic.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/external/bsd/file/dist/src
Module Name:src Committed By: christos Date: Thu Sep 11 13:30:04 UTC 2014 Modified Files: src/external/bsd/file/dist/src: encoding.c Log Message: PR/49192: remove dup assignment. To generate a diff of this commit: cvs rdiff -u -r1.1.1.5 -r1.2 src/external/bsd/file/dist/src/encoding.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/file/dist/src/encoding.c diff -u src/external/bsd/file/dist/src/encoding.c:1.1.1.5 src/external/bsd/file/dist/src/encoding.c:1.2 --- src/external/bsd/file/dist/src/encoding.c:1.1.1.5 Thu Jun 12 21:48:22 2014 +++ src/external/bsd/file/dist/src/encoding.c Thu Sep 11 09:30:04 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: encoding.c,v 1.1.1.5 2014/06/13 01:48:22 christos Exp $ */ +/* $NetBSD: encoding.c,v 1.2 2014/09/11 13:30:04 christos Exp $ */ /* * Copyright (c) Ian F. Darwin 1986-1995. * Software written by Ian F. Darwin and others; @@ -39,7 +39,7 @@ #if 0 FILE_RCSID(@(#)$File: encoding.c,v 1.9 2013/11/19 20:45:50 christos Exp $) #else -__RCSID($NetBSD: encoding.c,v 1.1.1.5 2014/06/13 01:48:22 christos Exp $); +__RCSID($NetBSD: encoding.c,v 1.2 2014/09/11 13:30:04 christos Exp $); #endif #endif /* lint */ @@ -102,7 +102,6 @@ file_encoding(struct magic_set *ms, cons *code_mime = utf-8; } else if (file_looks_utf8(buf, nbytes, *ubuf, ulen) 1) { DPRINTF((utf8 % SIZE_T_FORMAT u\n, *ulen)); - *code = UTF-8 Unicode (with BOM); *code = UTF-8 Unicode; *code_mime = utf-8; } else if ((ucs_type = looks_ucs16(buf, nbytes, *ubuf, ulen)) != 0) {
CVS commit: src/external/bsd/file/dist/src
Module Name:src Committed By: christos Date: Thu Sep 11 13:30:04 UTC 2014 Modified Files: src/external/bsd/file/dist/src: encoding.c Log Message: PR/49192: remove dup assignment. To generate a diff of this commit: cvs rdiff -u -r1.1.1.5 -r1.2 src/external/bsd/file/dist/src/encoding.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/external/bsd/file/dist/src
Module Name:src Committed By: joerg Date: Fri Jun 13 13:38:53 UTC 2014 Modified Files: src/external/bsd/file/dist/src: readelf.c Log Message: Initialise all fields. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/external/bsd/file/dist/src/readelf.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/file/dist/src/readelf.c diff -u src/external/bsd/file/dist/src/readelf.c:1.8 src/external/bsd/file/dist/src/readelf.c:1.9 --- src/external/bsd/file/dist/src/readelf.c:1.8 Fri Jun 13 02:08:06 2014 +++ src/external/bsd/file/dist/src/readelf.c Fri Jun 13 13:38:52 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: readelf.c,v 1.8 2014/06/13 02:08:06 christos Exp $ */ +/* $NetBSD: readelf.c,v 1.9 2014/06/13 13:38:52 joerg Exp $ */ /* * Copyright (c) Christos Zoulas 2003. * All Rights Reserved. @@ -31,7 +31,7 @@ #if 0 FILE_RCSID(@(#)$File: readelf.c,v 1.103 2014/05/02 02:25:10 christos Exp $) #else -__RCSID($NetBSD: readelf.c,v 1.8 2014/06/13 02:08:06 christos Exp $); +__RCSID($NetBSD: readelf.c,v 1.9 2014/06/13 13:38:52 joerg Exp $); #endif #endif @@ -473,8 +473,8 @@ private size_t donote(struct magic_set *ms, void *vbuf, size_t offset, size_t size, int clazz, int swap, size_t align, int *flags) { - Elf32_Nhdr nh32 = { 0 }; - Elf64_Nhdr nh64 = { 0 }; + Elf32_Nhdr nh32 = { 0, 0, 0 }; + Elf64_Nhdr nh64 = { 0, 0, 0 }; size_t noff, doff; #ifdef ELFCORE int os_style = -1;
CVS commit: src/external/bsd/file/dist/src
Module Name:src Committed By: joerg Date: Fri Jun 13 13:38:53 UTC 2014 Modified Files: src/external/bsd/file/dist/src: readelf.c Log Message: Initialise all fields. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/external/bsd/file/dist/src/readelf.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Re: CVS commit: src/external/bsd/file/dist/src
On Thu, 16 Jan 2014, Joerg Sonnenberger wrote: Module Name:src Committed By: joerg Date: Thu Jan 16 23:36:52 UTC 2014 Modified Files: src/external/bsd/file/dist/src: file.c Log Message: Only use __dead if it exists. I think the code would be easier to read with #ifndef __dead #define __dead /* nothing */ #endif --apb (Alan Barrett)
CVS commit: src/external/bsd/file/dist/src
Module Name:src Committed By: joerg Date: Thu Jan 16 23:35:54 UTC 2014 Modified Files: src/external/bsd/file/dist/src: file.c Log Message: Mark some more dead functions. To generate a diff of this commit: cvs rdiff -u -r1.1.1.6 -r1.2 src/external/bsd/file/dist/src/file.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/file/dist/src/file.c diff -u src/external/bsd/file/dist/src/file.c:1.1.1.6 src/external/bsd/file/dist/src/file.c:1.2 --- src/external/bsd/file/dist/src/file.c:1.1.1.6 Sun Dec 1 19:28:17 2013 +++ src/external/bsd/file/dist/src/file.c Thu Jan 16 23:35:54 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: file.c,v 1.1.1.6 2013/12/01 19:28:17 christos Exp $ */ +/* $NetBSD: file.c,v 1.2 2014/01/16 23:35:54 joerg Exp $ */ /* * Copyright (c) Ian F. Darwin 1986-1995. @@ -37,7 +37,7 @@ #if 0 FILE_RCSID(@(#)$File: file.c,v 1.152 2013/06/26 14:46:54 christos Exp $) #else -__RCSID($NetBSD: file.c,v 1.1.1.6 2013/12/01 19:28:17 christos Exp $); +__RCSID($NetBSD: file.c,v 1.2 2014/01/16 23:35:54 joerg Exp $); #endif #endif /* lint */ @@ -127,9 +127,9 @@ private const struct { private char *progname; /* used throughout */ -private void usage(void); +private void usage(void) __dead; private void docprint(const char *); -private void help(void); +private void help(void) __dead; private int unwrap(struct magic_set *, const char *); private int process(struct magic_set *ms, const char *, int);
CVS commit: src/external/bsd/file/dist/src
Module Name:src Committed By: joerg Date: Thu Jan 16 23:36:52 UTC 2014 Modified Files: src/external/bsd/file/dist/src: file.c Log Message: Only use __dead if it exists. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/external/bsd/file/dist/src/file.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/file/dist/src/file.c diff -u src/external/bsd/file/dist/src/file.c:1.2 src/external/bsd/file/dist/src/file.c:1.3 --- src/external/bsd/file/dist/src/file.c:1.2 Thu Jan 16 23:35:54 2014 +++ src/external/bsd/file/dist/src/file.c Thu Jan 16 23:36:52 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: file.c,v 1.2 2014/01/16 23:35:54 joerg Exp $ */ +/* $NetBSD: file.c,v 1.3 2014/01/16 23:36:52 joerg Exp $ */ /* * Copyright (c) Ian F. Darwin 1986-1995. @@ -37,7 +37,7 @@ #if 0 FILE_RCSID(@(#)$File: file.c,v 1.152 2013/06/26 14:46:54 christos Exp $) #else -__RCSID($NetBSD: file.c,v 1.2 2014/01/16 23:35:54 joerg Exp $); +__RCSID($NetBSD: file.c,v 1.3 2014/01/16 23:36:52 joerg Exp $); #endif #endif /* lint */ @@ -127,9 +127,15 @@ private const struct { private char *progname; /* used throughout */ -private void usage(void) __dead; +#ifdef __dead +__dead +#endif +private void usage(void); private void docprint(const char *); -private void help(void) __dead; +#ifdef __dead +__dead +#endif +private void help(void); private int unwrap(struct magic_set *, const char *); private int process(struct magic_set *ms, const char *, int);
CVS commit: src/external/bsd/file/dist/src
Module Name:src Committed By: joerg Date: Thu Jan 16 23:35:54 UTC 2014 Modified Files: src/external/bsd/file/dist/src: file.c Log Message: Mark some more dead functions. To generate a diff of this commit: cvs rdiff -u -r1.1.1.6 -r1.2 src/external/bsd/file/dist/src/file.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/external/bsd/file/dist/src
Module Name:src Committed By: joerg Date: Thu Jan 16 23:36:52 UTC 2014 Modified Files: src/external/bsd/file/dist/src: file.c Log Message: Only use __dead if it exists. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/external/bsd/file/dist/src/file.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/external/bsd/file/dist/src
Module Name:src Committed By: joerg Date: Tue Jan 7 02:12:07 UTC 2014 Modified Files: src/external/bsd/file/dist/src: file.h funcs.c Log Message: Format string checks for file_vprintf and file_error_core To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/external/bsd/file/dist/src/file.h cvs rdiff -u -r1.6 -r1.7 src/external/bsd/file/dist/src/funcs.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/file/dist/src/file.h diff -u src/external/bsd/file/dist/src/file.h:1.9 src/external/bsd/file/dist/src/file.h:1.10 --- src/external/bsd/file/dist/src/file.h:1.9 Sun Dec 1 19:32:15 2013 +++ src/external/bsd/file/dist/src/file.h Tue Jan 7 02:12:07 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: file.h,v 1.9 2013/12/01 19:32:15 christos Exp $ */ +/* $NetBSD: file.h,v 1.10 2014/01/07 02:12:07 joerg Exp $ */ /* * Copyright (c) Ian F. Darwin 1986-1995. @@ -417,7 +417,8 @@ protected int file_buffer(struct magic_s size_t); protected int file_fsmagic(struct magic_set *, const char *, struct stat *); protected int file_pipe2file(struct magic_set *, int, const void *, size_t); -protected int file_vprintf(struct magic_set *, const char *, va_list); +protected int file_vprintf(struct magic_set *, const char *, va_list) +__attribute__((__format__(__printf__, 2, 0))); protected size_t file_printedlen(const struct magic_set *); protected int file_replace(struct magic_set *, const char *, const char *); protected int file_printf(struct magic_set *, const char *, ...) Index: src/external/bsd/file/dist/src/funcs.c diff -u src/external/bsd/file/dist/src/funcs.c:1.6 src/external/bsd/file/dist/src/funcs.c:1.7 --- src/external/bsd/file/dist/src/funcs.c:1.6 Sun Dec 1 19:32:15 2013 +++ src/external/bsd/file/dist/src/funcs.c Tue Jan 7 02:12:07 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: funcs.c,v 1.6 2013/12/01 19:32:15 christos Exp $ */ +/* $NetBSD: funcs.c,v 1.7 2014/01/07 02:12:07 joerg Exp $ */ /* * Copyright (c) Christos Zoulas 2003. @@ -32,7 +32,7 @@ #if 0 FILE_RCSID(@(#)$File: funcs.c,v 1.64 2013/11/19 23:49:44 christos Exp $) #else -__RCSID($NetBSD: funcs.c,v 1.6 2013/12/01 19:32:15 christos Exp $); +__RCSID($NetBSD: funcs.c,v 1.7 2014/01/07 02:12:07 joerg Exp $); #endif #endif /* lint */ @@ -101,6 +101,7 @@ file_printf(struct magic_set *ms, const * error - print best error message possible */ /*VARARGS*/ +__attribute__((__format__(__printf__, 3, 0))) private void file_error_core(struct magic_set *ms, int error, const char *f, va_list va, size_t lineno)
CVS commit: src/external/bsd/file/dist/src
Module Name:src Committed By: joerg Date: Tue Jan 7 02:12:07 UTC 2014 Modified Files: src/external/bsd/file/dist/src: file.h funcs.c Log Message: Format string checks for file_vprintf and file_error_core To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/external/bsd/file/dist/src/file.h cvs rdiff -u -r1.6 -r1.7 src/external/bsd/file/dist/src/funcs.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/external/bsd/file/dist/src
Module Name:src Committed By: joerg Date: Thu Nov 28 14:40:00 UTC 2013 Modified Files: src/external/bsd/file/dist/src: compress.c Log Message: Spell the null pointer as NULL, not as nul. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/external/bsd/file/dist/src/compress.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/file/dist/src/compress.c diff -u src/external/bsd/file/dist/src/compress.c:1.6 src/external/bsd/file/dist/src/compress.c:1.7 --- src/external/bsd/file/dist/src/compress.c:1.6 Thu Jan 3 23:05:38 2013 +++ src/external/bsd/file/dist/src/compress.c Thu Nov 28 14:40:00 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: compress.c,v 1.6 2013/01/03 23:05:38 christos Exp $ */ +/* $NetBSD: compress.c,v 1.7 2013/11/28 14:40:00 joerg Exp $ */ /* * Copyright (c) Ian F. Darwin 1986-1995. @@ -40,7 +40,7 @@ #if 0 FILE_RCSID(@(#)$File: compress.c,v 1.70 2012/11/07 17:54:48 christos Exp $) #else -__RCSID($NetBSD: compress.c,v 1.6 2013/01/03 23:05:38 christos Exp $); +__RCSID($NetBSD: compress.c,v 1.7 2013/11/28 14:40:00 joerg Exp $); #endif #endif @@ -487,7 +487,7 @@ uncompressbuf(struct magic_set *ms, int #endif free(*newch); n = 0; - newch[0] = '\0'; + *newch = NULL; goto err; } else { n = r;
CVS commit: src/external/bsd/file/dist/src
Module Name:src Committed By: joerg Date: Thu Nov 28 14:40:00 UTC 2013 Modified Files: src/external/bsd/file/dist/src: compress.c Log Message: Spell the null pointer as NULL, not as nul. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/external/bsd/file/dist/src/compress.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/external/bsd/file/dist/src
Module Name:src Committed By: christos Date: Fri Jan 4 17:03:13 UTC 2013 Modified Files: src/external/bsd/file/dist/src: softmagic.c Log Message: bring return value fixes from head. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/external/bsd/file/dist/src/softmagic.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/file/dist/src/softmagic.c diff -u src/external/bsd/file/dist/src/softmagic.c:1.7 src/external/bsd/file/dist/src/softmagic.c:1.8 --- src/external/bsd/file/dist/src/softmagic.c:1.7 Thu Jan 3 18:05:38 2013 +++ src/external/bsd/file/dist/src/softmagic.c Fri Jan 4 12:03:13 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: softmagic.c,v 1.7 2013/01/03 23:05:38 christos Exp $ */ +/* $NetBSD: softmagic.c,v 1.8 2013/01/04 17:03:13 christos Exp $ */ /* * Copyright (c) Ian F. Darwin 1986-1995. @@ -37,7 +37,7 @@ #if 0 FILE_RCSID(@(#)$File: softmagic.c,v 1.155 2012/11/01 04:21:27 christos Exp $) #else -__RCSID($NetBSD: softmagic.c,v 1.7 2013/01/03 23:05:38 christos Exp $); +__RCSID($NetBSD: softmagic.c,v 1.8 2013/01/04 17:03:13 christos Exp $); #endif #endif /* lint */ @@ -49,9 +49,9 @@ __RCSID($NetBSD: softmagic.c,v 1.7 2013 private int match(struct magic_set *, struct magic *, uint32_t, -const unsigned char *, size_t, size_t, int, int, int); +const unsigned char *, size_t, size_t, int, int, int, int *); private int mget(struct magic_set *, const unsigned char *, -struct magic *, size_t, size_t, unsigned int, int, int, int); +struct magic *, size_t, size_t, unsigned int, int, int, int, int *); private int magiccheck(struct magic_set *, struct magic *); private int32_t mprint(struct magic_set *, struct magic *); private int32_t moffset(struct magic_set *, struct magic *); @@ -79,7 +79,7 @@ file_softmagic(struct magic_set *ms, con int rv; for (ml = ms-mlist[0]-next; ml != ms-mlist[0]; ml = ml-next) if ((rv = match(ms, ml-magic, ml-nmagic, buf, nbytes, 0, mode, - text, 0)) != 0) + text, 0, NULL)) != 0) return rv; return 0; @@ -115,16 +115,19 @@ file_softmagic(struct magic_set *ms, con private int match(struct magic_set *ms, struct magic *magic, uint32_t nmagic, const unsigned char *s, size_t nbytes, size_t offset, int mode, int text, -int flip) +int flip, int *returnval) { uint32_t magindex = 0; unsigned int cont_level = 0; int need_separator = 0; - int returnval = 0, e; /* if a match is found it is set to 1*/ + int returnvalv = 0, e; /* if a match is found it is set to 1*/ int firstline = 1; /* a flag to print X\n X\n- X */ int printed_something = 0; int print = (ms-flags (MAGIC_MIME|MAGIC_APPLE)) == 0; + if (returnval == NULL) + returnval = returnvalv; + if (file_check_mem(ms, cont_level) == -1) return -1; @@ -150,7 +153,7 @@ match(struct magic_set *ms, struct magic /* if main entry matches, print it... */ switch (mget(ms, s, m, nbytes, offset, cont_level, mode, text, - flip)) { + flip, returnval)) { case -1: return -1; case 0: @@ -158,7 +161,7 @@ match(struct magic_set *ms, struct magic break; default: if (m-type == FILE_INDIRECT) -returnval = 1; +*returnval = 1; switch (magiccheck(ms, m)) { case -1: @@ -184,6 +187,7 @@ match(struct magic_set *ms, struct magic } if ((e = handle_annotation(ms, m)) != 0) { + *returnval = 1; return e; } /* @@ -235,7 +239,7 @@ match(struct magic_set *ms, struct magic } #endif switch (mget(ms, s, m, nbytes, offset, cont_level, mode, - text, flip)) { + text, flip, returnval)) { case -1: return -1; case 0: @@ -245,7 +249,7 @@ match(struct magic_set *ms, struct magic break; default: if (m-type == FILE_INDIRECT) - returnval = 1; + *returnval = 1; flush = 0; break; } @@ -268,8 +272,10 @@ match(struct magic_set *ms, struct magic ms-c.li[cont_level].got_match = 0; break; } -if ((e = handle_annotation(ms, m)) != 0) +if ((e = handle_annotation(ms, m)) != 0) { + *returnval = 1; return e; +} /* * If we are going to print something, * make sure that we have a separator first. @@ -318,13 +324,13 @@ match(struct magic_set *ms, struct magic if (printed_something) { firstline = 0; if (print) -returnval = 1; +*returnval = 1; } if ((ms-flags MAGIC_CONTINUE) == 0 printed_something) { - return returnval; /* don't keep searching */ + return *returnval; /* don't keep searching */ } } - return returnval; /* This is hit if -k is set or there is no match */ + return *returnval; /* This is hit if -k is set or there is no match */ } private int @@ -1116,7 +1122,7 @@ mcopy(struct magic_set *ms, union VALUET private int mget(struct magic_set *ms, const unsigned char *s, struct magic *m, size_t nbytes, size_t o, unsigned int
CVS commit: src/external/bsd/file/dist/src
Module Name:src Committed By: christos Date: Fri Jan 4 17:03:13 UTC 2013 Modified Files: src/external/bsd/file/dist/src: softmagic.c Log Message: bring return value fixes from head. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/external/bsd/file/dist/src/softmagic.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/external/bsd/file/dist/src
Module Name:src Committed By: christos Date: Wed Sep 28 13:50:09 UTC 2011 Modified Files: src/external/bsd/file/dist/src: readcdf.c Log Message: fix cdf mime output on cdf files (from file HEAD) To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/external/bsd/file/dist/src/readcdf.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/file/dist/src/readcdf.c diff -u src/external/bsd/file/dist/src/readcdf.c:1.5 src/external/bsd/file/dist/src/readcdf.c:1.6 --- src/external/bsd/file/dist/src/readcdf.c:1.5 Sat Sep 17 06:46:52 2011 +++ src/external/bsd/file/dist/src/readcdf.c Wed Sep 28 09:50:09 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: readcdf.c,v 1.5 2011/09/17 10:46:52 joerg Exp $ */ +/* $NetBSD: readcdf.c,v 1.6 2011/09/28 13:50:09 christos Exp $ */ /*- * Copyright (c) 2008 Christos Zoulas @@ -31,7 +31,7 @@ #if 0 FILE_RCSID(@(#)$File: readcdf.c,v 1.26 2011/08/26 13:38:28 christos Exp $) #else -__RCSID($NetBSD: readcdf.c,v 1.5 2011/09/17 10:46:52 joerg Exp $); +__RCSID($NetBSD: readcdf.c,v 1.6 2011/09/28 13:50:09 christos Exp $); #endif #endif @@ -154,6 +154,9 @@ cdf_file_property_info(struct magic_set if (!NOTMIME(ms)) { if (str == NULL) return 0; + if (file_printf(ms, application/%s, str) == -1) + return -1; + } return 1; }
CVS commit: src/external/bsd/file/dist/src
Module Name:src Committed By: christos Date: Wed Sep 28 13:50:09 UTC 2011 Modified Files: src/external/bsd/file/dist/src: readcdf.c Log Message: fix cdf mime output on cdf files (from file HEAD) To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/external/bsd/file/dist/src/readcdf.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/external/bsd/file/dist/src
Module Name:src Committed By: joerg Date: Sat Sep 17 10:46:52 UTC 2011 Modified Files: src/external/bsd/file/dist/src: readcdf.c Log Message: Define __arraycount if it doesn't exist. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/external/bsd/file/dist/src/readcdf.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/file/dist/src/readcdf.c diff -u src/external/bsd/file/dist/src/readcdf.c:1.4 src/external/bsd/file/dist/src/readcdf.c:1.5 --- src/external/bsd/file/dist/src/readcdf.c:1.4 Fri Sep 16 21:06:27 2011 +++ src/external/bsd/file/dist/src/readcdf.c Sat Sep 17 10:46:52 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: readcdf.c,v 1.4 2011/09/16 21:06:27 christos Exp $ */ +/* $NetBSD: readcdf.c,v 1.5 2011/09/17 10:46:52 joerg Exp $ */ /*- * Copyright (c) 2008 Christos Zoulas @@ -31,7 +31,7 @@ #if 0 FILE_RCSID(@(#)$File: readcdf.c,v 1.26 2011/08/26 13:38:28 christos Exp $) #else -__RCSID($NetBSD: readcdf.c,v 1.4 2011/09/16 21:06:27 christos Exp $); +__RCSID($NetBSD: readcdf.c,v 1.5 2011/09/17 10:46:52 joerg Exp $); #endif #endif @@ -44,6 +44,10 @@ #include cdf.h #include magic.h +#ifndef __arraycount +#define __arraycount(a) (sizeof(a) / sizeof(a[0])) +#endif + #define NOTMIME(ms) (((ms)-flags MAGIC_MIME) == 0) private int
CVS commit: src/external/bsd/file/dist/src
Module Name:src Committed By: joerg Date: Sat Sep 17 10:46:52 UTC 2011 Modified Files: src/external/bsd/file/dist/src: readcdf.c Log Message: Define __arraycount if it doesn't exist. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/external/bsd/file/dist/src/readcdf.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/external/bsd/file/dist/src
Module Name:src Committed By: riz Date: Thu Jun 23 16:12:36 UTC 2011 Modified Files: src/external/bsd/file/dist/src: apprentice.c Log Message: Remove a noisy debugging printf that triggers on bigendian platforms. (Reported upstream as well) To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/external/bsd/file/dist/src/apprentice.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/file/dist/src/apprentice.c diff -u src/external/bsd/file/dist/src/apprentice.c:1.3 src/external/bsd/file/dist/src/apprentice.c:1.4 --- src/external/bsd/file/dist/src/apprentice.c:1.3 Fri May 13 01:52:13 2011 +++ src/external/bsd/file/dist/src/apprentice.c Thu Jun 23 16:12:36 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: apprentice.c,v 1.3 2011/05/13 01:52:13 christos Exp $ */ +/* $NetBSD: apprentice.c,v 1.4 2011/06/23 16:12:36 riz Exp $ */ /* * Copyright (c) Ian F. Darwin 1986-1995. @@ -37,7 +37,7 @@ #if 0 FILE_RCSID(@(#)$File: apprentice.c,v 1.169 2011/05/10 17:08:13 christos Exp $) #else -__RCSID($NetBSD: apprentice.c,v 1.3 2011/05/13 01:52:13 christos Exp $); +__RCSID($NetBSD: apprentice.c,v 1.4 2011/06/23 16:12:36 riz Exp $); #endif #endif /* lint */ @@ -2472,8 +2472,6 @@ m-in_offset = swap4((uint32_t)m-in_offset); m-lineno = swap4((uint32_t)m-lineno); if (IS_STRING(m-type)) { - if (m-type == FILE_PSTRING) - printf(flags! %d\n, m-str_flags); m-str_range = swap4(m-str_range); m-str_flags = swap4(m-str_flags); }
CVS commit: src/external/bsd/file/dist/src
Module Name:src Committed By: christos Date: Fri May 15 12:06:09 UTC 2009 Modified Files: src/external/bsd/file/dist/src: file.h Log Message: define __RCSID if nobody did. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/external/bsd/file/dist/src/file.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/file/dist/src/file.h diff -u src/external/bsd/file/dist/src/file.h:1.2 src/external/bsd/file/dist/src/file.h:1.3 --- src/external/bsd/file/dist/src/file.h:1.2 Fri May 8 13:28:01 2009 +++ src/external/bsd/file/dist/src/file.h Fri May 15 08:06:09 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: file.h,v 1.2 2009/05/08 17:28:01 christos Exp $ */ +/* $NetBSD: file.h,v 1.3 2009/05/15 12:06:09 christos Exp $ */ /* * Copyright (c) Ian F. Darwin 1986-1995. @@ -448,5 +448,8 @@ #else #define FILE_RCSID(id) #endif +#ifndef __RCSID +#define __RCSID(a) +#endif #endif /* __file_h__ */