Skip to content

Commit

Permalink
fix windows warning
Browse files Browse the repository at this point in the history
avoid : error C4703: potentially uninitialized local pointer variable 'prev_adapter' used
  • Loading branch information
notofug committed Jul 1, 2024
1 parent 83c6264 commit 1d7903e
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions oshw/win32/oshw.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,11 @@ uint16 oshw_ntohs (uint16 network)
*/
ec_adaptert * oshw_find_adapters (void)
{
int i = 0;
int ret = 0;
pcap_if_t *alldevs;
pcap_if_t *d;
ec_adaptert * adapter;
ec_adaptert * prev_adapter;
ec_adaptert * prev_adapter = NULL;
ec_adaptert * ret_adapter = NULL;
char errbuf[PCAP_ERRBUF_SIZE];

Expand All @@ -59,7 +58,7 @@ ec_adaptert * oshw_find_adapters (void)
* adapter.
* Else save as pointer to return.
*/
if (i)
if (prev_adapter)
{
prev_adapter->next = adapter;
}
Expand Down Expand Up @@ -89,7 +88,6 @@ ec_adaptert * oshw_find_adapters (void)
adapter->desc[0] = '\0';
}
prev_adapter = adapter;
i++;
}
/* free all devices allocated */
pcap_freealldevs(alldevs);
Expand Down

0 comments on commit 1d7903e

Please # to comment.