From c85c8fcb9fad565da78e01248c12f662f6bc04c8 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 17 Feb 2019 19:12:21 +0100 Subject: patch 8.1.0944: format of nbdbg() arguments is not checked Problem: Format of nbdbg() arguments is not checked. Solution: Add format attribute. Fix reported problems. (Dominique Pelle, closes #3992) --- src/nbdebug.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/nbdebug.h') diff --git a/src/nbdebug.h b/src/nbdebug.h index 6331f49c3..16dd84798 100644 --- a/src/nbdebug.h +++ b/src/nbdebug.h @@ -42,7 +42,11 @@ typedef enum { } WtWait; -void nbdbg(char *, ...); +void nbdbg(char *, ...) +#ifdef USE_PRINTF_FORMAT_ATTRIBUTE + __attribute__((format(printf, 1, 2))) +#endif +; void nbdebug_wait(u_int wait_flags, char *wait_var, u_int wait_secs); void nbdebug_log_init(char *log_var, char *level_var); -- cgit v1.2.1