From: Christos Zoulas Date: Tue, 7 Jan 2014 03:15:09 +0000 (+0000) Subject: add missing format attributes X-Git-Tag: FILE5_17~18 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=87f2be84d2f937c07165dc43933261b95b2c9a0c;p=file add missing format attributes --- diff --git a/src/file.h b/src/file.h index 5faa9ae5..ba6f05d9 100644 --- a/src/file.h +++ b/src/file.h @@ -27,7 +27,7 @@ */ /* * file.h - definitions for file(1) program - * @(#)$File: file.h,v 1.145 2013/04/22 15:30:11 christos Exp $ + * @(#)$File: file.h,v 1.146 2013/12/05 17:02:34 christos Exp $ */ #ifndef __file_h__ @@ -415,7 +415,8 @@ protected int file_buffer(struct magic_set *, int, const char *, const void *, 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 *, ...) diff --git a/src/funcs.c b/src/funcs.c index 90738f05..7f45bb93 100644 --- a/src/funcs.c +++ b/src/funcs.c @@ -27,7 +27,7 @@ #include "file.h" #ifndef lint -FILE_RCSID("@(#)$File: funcs.c,v 1.64 2013/11/19 23:49:44 christos Exp $") +FILE_RCSID("@(#)$File: funcs.c,v 1.65 2013/12/05 17:02:34 christos Exp $") #endif /* lint */ #include "magic.h" @@ -98,6 +98,7 @@ file_printf(struct magic_set *ms, const char *fmt, ...) * 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)