From: AZero13 Date: Thu, 15 May 2025 01:24:54 +0000 (-0400) Subject: safe_printf should annotate with restrict (#2605) X-Git-Tag: v3.8.0~24 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b50b8a42f62d8b99f711a9a02cc46cfca5c08464;p=thirdparty%2Flibarchive.git safe_printf should annotate with restrict (#2605) printf has restrict for its parameters, and safe_printf should do the same. --- diff --git a/tar/bsdtar.h b/tar/bsdtar.h index 65ab969b8..ac995c82b 100644 --- a/tar/bsdtar.h +++ b/tar/bsdtar.h @@ -182,7 +182,7 @@ void do_chdir(struct bsdtar *); int edit_pathname(struct bsdtar *, struct archive_entry *); int need_report(void); int pathcmp(const char *a, const char *b); -void safe_fprintf(FILE *, const char *fmt, ...) __LA_PRINTF(2, 3); +void safe_fprintf(FILE * restrict, const char * restrict fmt, ...) __LA_PRINTF(2, 3); void set_chdir(struct bsdtar *, const char *newdir); const char *tar_i64toa(int64_t); void tar_mode_c(struct bsdtar *bsdtar); diff --git a/tar/util.c b/tar/util.c index a63883527..39d5c452e 100644 --- a/tar/util.c +++ b/tar/util.c @@ -72,7 +72,7 @@ static const char *strip_components(const char *path, int elements); */ void -safe_fprintf(FILE *f, const char *fmt, ...) +safe_fprintf(FILE * restrict f, const char * restrict fmt, ...) { char fmtbuff_stack[256]; /* Place to format the printf() string. */ char outbuff[256]; /* Buffer for outgoing characters. */