diff options
author | Guy Harris <gharris@sonic.net> | 2021-01-19 16:42:39 -0800 |
---|---|---|
committer | Guy Harris <gharris@sonic.net> | 2021-01-19 16:42:39 -0800 |
commit | 793333d039da31df911803f0d3d7e8ae22eeb20e (patch) | |
tree | f93aaf20c5c9f10dd81a5695b3a7162acf14fd35 /caputils | |
parent | c6d1031328472dec2f7dd73edabb9bdbf9bad0f1 (diff) |
Make some loop indices private to their loops.
This also squelches a cppcheck unreadVariable warning.
Diffstat (limited to 'caputils')
-rw-r--r-- | caputils/airpcap_loader.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/caputils/airpcap_loader.c b/caputils/airpcap_loader.c index 8ab2ce3560..c5c8bb867e 100644 --- a/caputils/airpcap_loader.c +++ b/caputils/airpcap_loader.c @@ -213,7 +213,7 @@ Dot11Channel* airpcap_if_get_device_supported_channels_array(PAirpcapHandle ah, guint * pNumSupportedChannels) { AirpcapChannelInfo *chanInfo; - guint i=0, j=0, numInfo = 0; + guint numInfo = 0; if (!AirpcapLoaded) return NULL; @@ -229,14 +229,14 @@ airpcap_if_get_device_supported_channels_array(PAirpcapHandle ah, guint * pNumSu pSupportedChannels = (Dot11Channel *)g_malloc(numInfo * (sizeof *pSupportedChannels)); - for (i = 0; i < numInfo; i++) + for (guint i = 0; i < numInfo; i++) { guint supportedChannel = G_MAXUINT; /* * search if we have it already */ - for (j = 0; j < numSupportedChannels; j++) + for (guint j = 0; j < numSupportedChannels; j++) { if (pSupportedChannels[j].Frequency == chanInfo[i].Frequency) { @@ -301,9 +301,9 @@ airpcap_if_get_device_supported_channels_array(PAirpcapHandle ah, guint * pNumSu /* * Now sort the list by frequency */ - for (i = 0 ; i < numSupportedChannels - 1; i++) + for (guint i = 0; i < numSupportedChannels - 1; i++) { - for (j = i + 1; j < numSupportedChannels; j++) + for (guint j = i + 1; j < numSupportedChannels; j++) { if (pSupportedChannels[i].Frequency > pSupportedChannels[j].Frequency) { |