aboutsummaryrefslogtreecommitdiffstats
path: root/airpcap_loader.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2013-02-17 03:45:06 +0000
committerGuy Harris <guy@alum.mit.edu>2013-02-17 03:45:06 +0000
commit8d7ffcc99b02ffd0315e32ab26678fe6058f1289 (patch)
treee42f5dcc01845d5517399b454286f3e1816b8063 /airpcap_loader.c
parent806cb7224df91bbaac0744a881c185fdf25fe9ea (diff)
Add a macro that, for a given count of keys, returns the total size of
an AirpcapKeysCollection structure with that number of keys, and use it instead of doing the calculation manually. svn path=/trunk/; revision=47699
Diffstat (limited to 'airpcap_loader.c')
-rw-r--r--airpcap_loader.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/airpcap_loader.c b/airpcap_loader.c
index 3b745823c2..fca1d3179d 100644
--- a/airpcap_loader.c
+++ b/airpcap_loader.c
@@ -350,7 +350,7 @@ write_wlan_wep_keys_to_registry(airpcap_if_info_t* info_if, GList* key_list)
/*
* Calculate the size of the keys collection
*/
- KeysCollectionSize = (guint)(sizeof(AirpcapKeysCollection) + keys_in_list * sizeof(AirpcapKey));
+ KeysCollectionSize = (guint)AirpcapKeysCollectionSize(keys_in_list);
/*
* Allocate the collection
@@ -449,7 +449,7 @@ write_wlan_driver_wep_keys_to_registry(GList* key_list)
/*
* Calculate the size of the keys collection
*/
- KeysCollectionSize = (guint)(sizeof(AirpcapKeysCollection) + keys_in_list * sizeof(AirpcapKey));
+ KeysCollectionSize = (guint)AirpcapKeysCollectionSize(keys_in_list);
/*
* Allocate the collection