From b50b8a42f62d8b99f711a9a02cc46cfca5c08464 Mon Sep 17 00:00:00 2001 From: AZero13 Date: Wed, 14 May 2025 21:24:54 -0400 Subject: [PATCH] safe_printf should annotate with restrict (#2605) printf has restrict for its parameters, and safe_printf should do the same. --- tar/bsdtar.h | 2 +- tar/util.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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. */ -- 2.47.3