[wpa_supplicant] small patches

Cristian Ionescu-Idbohrn cristian.ionescu-idbohrn
Tue Sep 27 03:15:17 PDT 2005


Please find attached some small and simple patches, dealing with
whitespace cleanup and 'global declaration shadowing' compiler
warnings (the result of a local policy to use the '-Wshadow' gcc
option). Please apply.


Cheers,
Cristian
-------------- next part --------------
wpa_supplicant/config_file.c:472:
  warning: declaration of `index' shadows a global declaration

--- config_file.c.orig	2005-09-25 19:28:16.000000000 +0200
+++ config_file.c	2005-09-27 11:38:58.505470456 +0200
@@ -232,7 +232,7 @@
 				config->ctrl_interface_gid_set = 1;
 				wpa_printf(MSG_DEBUG, "ctrl_interface_group=%d"
 					   " (from group name '%s')",
-					   (int) config->ctrl_interface_gid, 
+					   (int) config->ctrl_interface_gid,
 					   group);
 				continue;
 			}
@@ -469,11 +469,11 @@
 }
 
 
-static void write_wep_key(FILE *f, int index, struct wpa_ssid *ssid)
+static void write_wep_key(FILE *f, int idx, struct wpa_ssid *ssid)
 {
 	char field[20], *value;
 
-	snprintf(field, sizeof(field), "wep_key%d", index);
+	snprintf(field, sizeof(field), "wep_key%d", idx);
 	value = wpa_config_get(ssid, field);
 	if (value) {
 		fprintf(f, "\t%s=%s\n", field, value);

--------------------------------------------------------------------------

wpa_supplicant/eap_tls_common.c:128:
  warning: declaration of `random' shadows a global declaration

--- eap_tls_common.c.orig	2005-09-17 16:37:39.000000000 +0200
+++ eap_tls_common.c	2005-09-27 11:42:03.587214700 +0200
@@ -125,30 +125,30 @@
 			char *label, size_t len)
 {
 	struct tls_keys keys;
-	u8 *random;
+	u8 *rnd;
 	u8 *out;
 
 	if (tls_connection_get_keys(sm->ssl_ctx, data->conn, &keys))
 		return NULL;
 	out = malloc(len);
-	random = malloc(keys.client_random_len + keys.server_random_len);
-	if (out == NULL || random == NULL) {
+	rnd = malloc(keys.client_random_len + keys.server_random_len);
+	if (out == NULL || rnd == NULL) {
 		free(out);
-		free(random);
+		free(rnd);
 		return NULL;
 	}
-	memcpy(random, keys.client_random, keys.client_random_len);
-	memcpy(random + keys.client_random_len, keys.server_random,
+	memcpy(rnd, keys.client_random, keys.client_random_len);
+	memcpy(rnd + keys.client_random_len, keys.server_random,
 	       keys.server_random_len);
 
 	if (tls_prf(keys.master_key, keys.master_key_len,
-		    label, random, keys.client_random_len +
+		    label, rnd, keys.client_random_len +
 		    keys.server_random_len, out, len)) {
-		free(random);
+		free(rnd);
 		free(out);
 		return NULL;
 	}
-	free(random);
+	free(rnd);
 	return out;
 }
 
@@ -164,7 +164,7 @@
  * to reassemble this TLS packet
  * Returns: Pointer to output data or %NULL on error
  *
- * This function reassembles TLS fragments. 
+ * This function reassembles TLS fragments.
  */
 const u8 * eap_tls_data_reassemble(
 	struct eap_sm *sm, struct eap_ssl_data *data, const u8 *in_data,

--------------------------------------------------------------------------

wpa_supplicant/wpa_cli.c:1099:
  warning: declaration of `action_file' shadows a global declaration

--- wpa_cli.c.orig	2005-09-25 19:31:07.000000000 +0200
+++ wpa_cli.c	2005-09-27 11:48:36.761297600 +0200
@@ -454,7 +454,7 @@
 		       "(network id and pin)\n");
 		return 0;
 	}
-	
+
 	end = cmd + sizeof(cmd);
 	pos = cmd;
 	pos += snprintf(pos, end - pos, WPA_CTRL_RSP "PIN-%s:%s",
@@ -1096,7 +1096,7 @@
 }
 
 
-static void wpa_cli_action(struct wpa_ctrl *ctrl, const char *action_file)
+static void wpa_cli_action(struct wpa_ctrl *ctrl)
 {
 	fd_set rfds;
 	int fd, res;
@@ -1305,7 +1305,7 @@
 	if (interactive)
 		wpa_cli_interactive();
 	else if (action_file)
-		wpa_cli_action(ctrl_conn, action_file);
+		wpa_cli_action(ctrl_conn);
 	else
 		wpa_request(ctrl_conn, argc - optind, &argv[optind]);
 
--------------------------------------------------------------------------



More information about the Hostap mailing list