From b000803fe3ec89a9cb63294191d4783638cc0429 Mon Sep 17 00:00:00 2001 From: chme Date: Sat, 26 Jan 2019 10:08:11 +0100 Subject: [PATCH] [misc] Add compiler hint to check format parameters --- src/misc.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/misc.h b/src/misc.h index edc63c19..0fb6416f 100644 --- a/src/misc.h +++ b/src/misc.h @@ -56,10 +56,10 @@ char * safe_strdup(const char *str); char * -safe_asprintf(const char *fmt, ...); +safe_asprintf(const char *fmt, ...) __attribute__ ((format (printf, 1, 2))); int -safe_snprintf_cat(char *dst, size_t n, const char *fmt, ...); +safe_snprintf_cat(char *dst, size_t n, const char *fmt, ...) __attribute__ ((format (printf, 3, 4))); /* Key/value functions */