[PATCH 1/1] Fix printf format strings.

David Ruth druth at chromium.org
Tue Jul 21 18:37:57 PDT 2026


Variables of type size_t should be printed with the %z printf format
specifier. Variables that represent a difference of pointers should be
printed with the %t printf format specifier.

Signed-off-by: David Ruth <druth at chromium.org>
---
 src/ap/ieee802_11_eht.c | 4 ++--
 src/ap/wpa_auth.c       | 8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/ap/ieee802_11_eht.c b/src/ap/ieee802_11_eht.c
index b76814489..8579f363c 100644
--- a/src/ap/ieee802_11_eht.c
+++ b/src/ap/ieee802_11_eht.c
@@ -1366,7 +1366,7 @@ u16 hostapd_process_ml_assoc_req(struct hostapd_data *hapd,
 		wpa_printf(MSG_DEBUG, "MLD: EXT ML capabilities not present");
 	}
 
-	wpa_printf(MSG_DEBUG, "MLD: expected_common_info_len=%lu",
+	wpa_printf(MSG_DEBUG, "MLD: expected_common_info_len=%zu",
 		   common_info_len);
 
 	if (sizeof(*ml) + common_info_len > ml_len) {
@@ -2118,7 +2118,7 @@ hostapd_send_link_reconf_resp(struct hostapd_data *hapd,
 							  false, true);
 		if ((size_t) (mle_pos - pos) != mle_len) {
 			wpa_printf(MSG_DEBUG,
-				   "MLD: Unexpected MLE length: %ld != %zu",
+				   "MLD: Unexpected MLE length: %td != %zu",
 				   mle_pos - pos, mle_len);
 			reject_all = true;
 			goto reject_all_req;
diff --git a/src/ap/wpa_auth.c b/src/ap/wpa_auth.c
index 74e65d3f7..03efa54ef 100644
--- a/src/ap/wpa_auth.c
+++ b/src/ap/wpa_auth.c
@@ -4618,7 +4618,7 @@ u8 * wpa_auth_ml_group_kdes(struct wpa_state_machine *sm, u8 *pos,
 	}
 
 	if (!sm->mgmt_frame_prot) {
-		wpa_printf(MSG_DEBUG, "RSN: MLO Group KDE len = %ld",
+		wpa_printf(MSG_DEBUG, "RSN: MLO Group KDE len = %td",
 			   pos - start);
 		return pos;
 	}
@@ -4661,7 +4661,7 @@ u8 * wpa_auth_ml_group_kdes(struct wpa_state_machine *sm, u8 *pos,
 	}
 
 	if (!sm->wpa_auth->conf.beacon_prot) {
-		wpa_printf(MSG_DEBUG, "RSN: MLO Group KDE len = %ld",
+		wpa_printf(MSG_DEBUG, "RSN: MLO Group KDE len = %td",
 			   pos - start);
 		return pos;
 	}
@@ -4704,7 +4704,7 @@ u8 * wpa_auth_ml_group_kdes(struct wpa_state_machine *sm, u8 *pos,
 		pos += ml_key_info.links[i].igtk_len;
 	}
 
-	wpa_printf(MSG_DEBUG, "RSN: MLO Group KDE len = %ld", pos - start);
+	wpa_printf(MSG_DEBUG, "RSN: MLO Group KDE len = %td", pos - start);
 	return pos;
 }
 
@@ -4898,7 +4898,7 @@ static u8 * wpa_auth_ml_kdes(struct wpa_state_machine *sm, u8 *pos)
 	}
 
 	wpa_printf(MSG_DEBUG,
-		   "RSN: MLO Link KDEs and RSN Override Link KDEs len = %ld",
+		   "RSN: MLO Link KDEs and RSN Override Link KDEs len = %td",
 		   pos - start);
 	pos = wpa_auth_ml_group_kdes(sm, pos, KDE_ALL_LINKS);
 #endif /* CONFIG_IEEE80211BE */
-- 
2.55.0.229.g6434b31f56-goog




More information about the Hostap mailing list