Browse Source

Fixed size_t printf format for 64-bit targets

Jouni Malinen 16 years ago
parent
commit
dd20838a7d
2 changed files with 17 additions and 10 deletions
  1. 5 4
      src/eap_server/eap_fast.c
  2. 12 6
      src/eap_server/eap_gpsk.c

+ 5 - 4
src/eap_server/eap_fast.c

@@ -1030,20 +1030,21 @@ static void eap_fast_process_phase2_eap(struct eap_sm *sm,
 	hdr = (struct eap_hdr *) in_data;
 	if (in_len < (int) sizeof(*hdr)) {
 		wpa_printf(MSG_INFO, "EAP-FAST: Too short Phase 2 "
-			   "EAP frame (len=%d)", in_len);
+			   "EAP frame (len=%lu)", (unsigned long) in_len);
 		eap_fast_req_failure(sm, data);
 		return;
 	}
 	len = be_to_host16(hdr->length);
 	if (len > in_len) {
 		wpa_printf(MSG_INFO, "EAP-FAST: Length mismatch in "
-			   "Phase 2 EAP frame (len=%d hdr->length=%d)",
-			   in_len, len);
+			   "Phase 2 EAP frame (len=%lu hdr->length=%lu)",
+			   (unsigned long) in_len, (unsigned long) len);
 		eap_fast_req_failure(sm, data);
 		return;
 	}
 	wpa_printf(MSG_DEBUG, "EAP-FAST: Received Phase 2: code=%d "
-		   "identifier=%d length=%d", hdr->code, hdr->identifier, len);
+		   "identifier=%d length=%lu", hdr->code, hdr->identifier,
+		   (unsigned long) len);
 	switch (hdr->code) {
 	case EAP_CODE_RESPONSE:
 		eap_fast_process_phase2_response(sm, data, (u8 *) hdr, len);

+ 12 - 6
src/eap_server/eap_gpsk.c

@@ -433,7 +433,9 @@ static void eap_gpsk_process_gpsk_2(struct eap_sm *sm,
 	miclen = eap_gpsk_mic_len(data->vendor, data->specifier);
 	if (end - pos < (int) miclen) {
 		wpa_printf(MSG_DEBUG, "EAP-GPSK: Message too short for MIC "
-			   "(left=%d miclen=%d)", end - pos, miclen);
+			   "(left=%lu miclen=%lu)",
+			   (unsigned long) (end - pos),
+			   (unsigned long) miclen);
 		eap_gpsk_state(data, FAILURE);
 		return;
 	}
@@ -454,8 +456,9 @@ static void eap_gpsk_process_gpsk_2(struct eap_sm *sm,
 	pos += miclen;
 
 	if (pos != end) {
-		wpa_printf(MSG_DEBUG, "EAP-GPSK: Ignored %d bytes of extra "
-			   "data in the end of GPSK-2", end - pos);
+		wpa_printf(MSG_DEBUG, "EAP-GPSK: Ignored %lu bytes of extra "
+			   "data in the end of GPSK-2",
+			   (unsigned long) (end - pos));
 	}
 
 	eap_gpsk_state(data, GPSK_3);
@@ -499,7 +502,9 @@ static void eap_gpsk_process_gpsk_4(struct eap_sm *sm,
 	miclen = eap_gpsk_mic_len(data->vendor, data->specifier);
 	if (end - pos < (int) miclen) {
 		wpa_printf(MSG_DEBUG, "EAP-GPSK: Message too short for MIC "
-			   "(left=%d miclen=%d)", end - pos, miclen);
+			   "(left=%lu miclen=%lu)",
+			   (unsigned long) (end - pos),
+			   (unsigned long) miclen);
 		eap_gpsk_state(data, FAILURE);
 		return;
 	}
@@ -520,8 +525,9 @@ static void eap_gpsk_process_gpsk_4(struct eap_sm *sm,
 	pos += miclen;
 
 	if (pos != end) {
-		wpa_printf(MSG_DEBUG, "EAP-GPSK: Ignored %d bytes of extra "
-			   "data in the end of GPSK-4", end - pos);
+		wpa_printf(MSG_DEBUG, "EAP-GPSK: Ignored %lu bytes of extra "
+			   "data in the end of GPSK-4",
+			   (unsigned long) (end - pos));
 	}
 
 	eap_gpsk_state(data, SUCCESS);