From fa6248b1f19538c9ca2d954bfbea3aba8138c0f9 Mon Sep 17 00:00:00 2001 From: Jianhui Zhao Date: Fri, 15 Jan 2021 15:40:21 +0800 Subject: [PATCH] uh_log_xx: check the arguments like printf Signed-off-by: Jianhui Zhao --- src/log.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/log.h b/src/log.h index 96a6647..772b08d 100644 --- a/src/log.h +++ b/src/log.h @@ -40,6 +40,7 @@ void uh_log_close(); #define uh_log_info(fmt...) uh_log(LOG_INFO, fmt) #define uh_log_err(fmt...) uh_log(LOG_ERR, fmt) -void __uh_log(const char *filename, int line, int priority, const char *fmt, ...); +void __uh_log(const char *filename, int line, int priority, const char *fmt, ...) + __attribute__((format(printf, 4, 5))); #endif