mirror of
https://github.com/nmap/nmap.git
synced 2025-12-20 14:39:02 +00:00
Declare variables before executing any statement to follow
C standards. Report and original patch by Gisle Vanem.
This commit is contained in:
@@ -205,8 +205,10 @@ void nsi_delete(nsock_iod nsockiod, int pending_response) {
|
|||||||
|
|
||||||
for (i = 0; i < 3 && nsi->events_pending > 0; i++) {
|
for (i = 0; i < 3 && nsi->events_pending > 0; i++) {
|
||||||
for (current = evlist_ar[i]; current != NULL; current = next) {
|
for (current = evlist_ar[i]; current != NULL; current = next) {
|
||||||
|
msevent *nse;
|
||||||
|
|
||||||
next = GH_LIST_ELEM_NEXT(current);
|
next = GH_LIST_ELEM_NEXT(current);
|
||||||
msevent *nse = (msevent *)GH_LIST_ELEM_DATA(current);
|
nse = (msevent *)GH_LIST_ELEM_DATA(current);
|
||||||
|
|
||||||
/* we're done with this list of events for the current IOD */
|
/* we're done with this list of events for the current IOD */
|
||||||
if (nse->iod != nsi)
|
if (nse->iod != nsi)
|
||||||
|
|||||||
@@ -104,10 +104,7 @@ char* nsock_pcap_open(nsock_pool nsp, nsock_iod nsiod, const char *pcap_device,
|
|||||||
int failed, datalink;
|
int failed, datalink;
|
||||||
char *e;
|
char *e;
|
||||||
|
|
||||||
gettimeofday(&nsock_tod, NULL);
|
|
||||||
|
|
||||||
#ifdef PCAP_CAN_DO_SELECT
|
#ifdef PCAP_CAN_DO_SELECT
|
||||||
|
|
||||||
#if PCAP_BSD_SELECT_HACK
|
#if PCAP_BSD_SELECT_HACK
|
||||||
/* MacOsX reports error if to_ms is too big (like INT_MAX) with error
|
/* MacOsX reports error if to_ms is too big (like INT_MAX) with error
|
||||||
* FAILED. Reported error: BIOCSRTIMEOUT: Invalid argument
|
* FAILED. Reported error: BIOCSRTIMEOUT: Invalid argument
|
||||||
@@ -121,6 +118,8 @@ char* nsock_pcap_open(nsock_pool nsp, nsock_iod nsiod, const char *pcap_device,
|
|||||||
int to_ms = 1;
|
int to_ms = 1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
gettimeofday(&nsock_tod, NULL);
|
||||||
|
|
||||||
if (mp)
|
if (mp)
|
||||||
return "nsock-pcap: this nsi already has pcap device opened";
|
return "nsock-pcap: this nsi already has pcap device opened";
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user