From d0843fad51200748c90828b071b88abbcd0e7985 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Thu, 14 Nov 2019 21:31:30 +0100 Subject: [PATCH] add format attribute to set_dbparam src/tcbtdb.c:124:49: error: format string is not a string literal [-Werror,-Wformat-nonliteral] n = vsnprintf (params + len, DB_PARAMS - len, fmt, args); ^~~ 1 error generated. --- src/tcbtdb.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/tcbtdb.c b/src/tcbtdb.c index a5090381da..a32c0266ac 100644 --- a/src/tcbtdb.c +++ b/src/tcbtdb.c @@ -114,6 +114,9 @@ tc_db_rmdir () * On error, a negative number is returned. * On success, the number of characters that would have been written is * returned. */ +#if defined(__GNUC__) || defined(__clang__) +__attribute__((__format__(printf,3,4))) +#endif static int set_dbparam (char *params, int len, const char *fmt, ...) {