]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Add PRINTF_FORMAT for printf wrapper functions
authorJouni Malinen <j@w1.fi>
Sat, 2 May 2020 17:25:21 +0000 (20:25 +0300)
committerJouni Malinen <j@w1.fi>
Sat, 2 May 2020 18:04:17 +0000 (21:04 +0300)
This avoids compiler format-nonliteral warnings ("format string is not a
string literal").

Signed-off-by: Jouni Malinen <j@w1.fi>
src/ap/wpa_auth_i.h
src/eapol_auth/eapol_auth_sm.c
src/utils/common.h

index af0aaca1bc412e6c11a2db76c9b3e3c6bdbfd1f9..ba08ac257067ee34859a4b2ce18301de33164cb8 100644 (file)
@@ -277,7 +277,8 @@ int wpa_write_rsnxe(struct wpa_auth_config *conf, u8 *buf, size_t len);
 void wpa_auth_logger(struct wpa_authenticator *wpa_auth, const u8 *addr,
                     logger_level level, const char *txt);
 void wpa_auth_vlogger(struct wpa_authenticator *wpa_auth, const u8 *addr,
-                     logger_level level, const char *fmt, ...);
+                     logger_level level, const char *fmt, ...)
+       PRINTF_FORMAT(4, 5);
 void __wpa_send_eapol(struct wpa_authenticator *wpa_auth,
                      struct wpa_state_machine *sm, int key_info,
                      const u8 *key_rsc, const u8 *nonce,
index e3a57e7db860f2c6fb43734d3ef9b11b5c232c48..1c11cb613bd53e64e423ccdf8c1ef413ff123f5f 100644 (file)
@@ -56,6 +56,7 @@ static void eapol_auth_logger(struct eapol_authenticator *eapol,
 }
 
 
+PRINTF_FORMAT(4, 5)
 static void eapol_auth_vlogger(struct eapol_authenticator *eapol,
                               const u8 *addr, eapol_logger_level level,
                               const char *fmt, ...)
index 8e5cfe16a855ea14d25c88c7eb8a2392f2963142..45f72bb30984e089620433c8123b0279f9673148 100644 (file)
@@ -482,7 +482,8 @@ int hexstr2bin(const char *hex, u8 *buf, size_t len);
 void inc_byte_array(u8 *counter, size_t len);
 void buf_shift_right(u8 *buf, size_t len, size_t bits);
 void wpa_get_ntp_timestamp(u8 *buf);
-int wpa_scnprintf(char *buf, size_t size, const char *fmt, ...);
+int wpa_scnprintf(char *buf, size_t size, const char *fmt, ...)
+       PRINTF_FORMAT(3, 4);
 int wpa_snprintf_hex_sep(char *buf, size_t buf_size, const u8 *data, size_t len,
                         char sep);
 int wpa_snprintf_hex(char *buf, size_t buf_size, const u8 *data, size_t len);