Browse Source

Mark fmt parameter const for wpa_printf/msg

Jouni Malinen 15 years ago
parent
commit
0de4da91c1
2 changed files with 7 additions and 6 deletions
  1. 3 3
      src/utils/wpa_debug.c
  2. 4 3
      src/utils/wpa_debug.h

+ 3 - 3
src/utils/wpa_debug.c

@@ -95,7 +95,7 @@ static int syslog_priority(int level)
  *
  *
  * Note: New line '\n' is added to the end of the text when printing to stdout.
  * Note: New line '\n' is added to the end of the text when printing to stdout.
  */
  */
-void wpa_printf(int level, char *fmt, ...)
+void wpa_printf(int level, const char *fmt, ...)
 {
 {
 	va_list ap;
 	va_list ap;
 
 
@@ -314,7 +314,7 @@ void wpa_msg_register_cb(wpa_msg_cb_func func)
 }
 }
 
 
 
 
-void wpa_msg(void *ctx, int level, char *fmt, ...)
+void wpa_msg(void *ctx, int level, const char *fmt, ...)
 {
 {
 	va_list ap;
 	va_list ap;
 	char *buf;
 	char *buf;
@@ -337,7 +337,7 @@ void wpa_msg(void *ctx, int level, char *fmt, ...)
 }
 }
 
 
 
 
-void wpa_msg_ctrl(void *ctx, int level, char *fmt, ...)
+void wpa_msg_ctrl(void *ctx, int level, const char *fmt, ...)
 {
 {
 	va_list ap;
 	va_list ap;
 	char *buf;
 	char *buf;

+ 4 - 3
src/utils/wpa_debug.h

@@ -60,7 +60,7 @@ void wpa_debug_print_timestamp(void);
  *
  *
  * Note: New line '\n' is added to the end of the text when printing to stdout.
  * Note: New line '\n' is added to the end of the text when printing to stdout.
  */
  */
-void wpa_printf(int level, char *fmt, ...)
+void wpa_printf(int level, const char *fmt, ...)
 PRINTF_FORMAT(2, 3);
 PRINTF_FORMAT(2, 3);
 
 
 /**
 /**
@@ -158,7 +158,7 @@ void wpa_hexdump_ascii_key(int level, const char *title, const u8 *buf,
  *
  *
  * Note: New line '\n' is added to the end of the text when printing to stdout.
  * Note: New line '\n' is added to the end of the text when printing to stdout.
  */
  */
-void wpa_msg(void *ctx, int level, char *fmt, ...) PRINTF_FORMAT(3, 4);
+void wpa_msg(void *ctx, int level, const char *fmt, ...) PRINTF_FORMAT(3, 4);
 
 
 /**
 /**
  * wpa_msg_ctrl - Conditional printf for ctrl_iface monitors
  * wpa_msg_ctrl - Conditional printf for ctrl_iface monitors
@@ -172,7 +172,8 @@ void wpa_msg(void *ctx, int level, char *fmt, ...) PRINTF_FORMAT(3, 4);
  * attached ctrl_iface monitors. In other words, it can be used for frequent
  * attached ctrl_iface monitors. In other words, it can be used for frequent
  * events that do not need to be sent to syslog.
  * events that do not need to be sent to syslog.
  */
  */
-void wpa_msg_ctrl(void *ctx, int level, char *fmt, ...) PRINTF_FORMAT(3, 4);
+void wpa_msg_ctrl(void *ctx, int level, const char *fmt, ...)
+PRINTF_FORMAT(3, 4);
 
 
 typedef void (*wpa_msg_cb_func)(void *ctx, int level, const char *txt,
 typedef void (*wpa_msg_cb_func)(void *ctx, int level, const char *txt,
 				size_t len);
 				size_t len);