Skip to content

Commit

Permalink
Fix indexing
Browse files Browse the repository at this point in the history
  • Loading branch information
Andras Fekete committed Sep 26, 2024
1 parent 889c8f4 commit f7c5520
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sslSniffer/sslSnifferTest/snifftest.c
Original file line number Diff line number Diff line change
Expand Up @@ -1050,8 +1050,8 @@ int main(int argc, char** argv)
if (pcap_findalldevs(&alldevs, err) == -1)
err_sys("Error in pcap_findalldevs");

for (d = alldevs; d; d=d->next) {
printf("%d. %s", i++, d->name);
for (d = alldevs, i = 0; d; d=d->next) {
printf("%d. %s", ++i, d->name);
if (strcmp(d->name, "lo0") == 0) {
defDev = i;
}
Expand All @@ -1076,6 +1076,7 @@ int main(int argc, char** argv)

/* Jump to the selected adapter */
for (d = alldevs, i = 0; i < inum - 1; d = d->next, i++);
printf("Selected %s\n", d->name);

pcap = pcap_create(d->name, err);

Expand Down

0 comments on commit f7c5520

Please sign in to comment.