mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-04 08:35:06 -05:00
ntp: fix compiler warnings
Warnings about using uninitialized variables were seen with gcc-7.3.1 and -O3 in CFLAGS.
This commit is contained in:
@@ -207,11 +207,12 @@ find_slot(NTP_Remote_Address *remote_addr, int *slot, int *found)
|
|||||||
|
|
||||||
size = ARR_GetSize(records);
|
size = ARR_GetSize(records);
|
||||||
|
|
||||||
|
*slot = 0;
|
||||||
|
*found = 0;
|
||||||
|
|
||||||
if (remote_addr->ip_addr.family != IPADDR_INET4 &&
|
if (remote_addr->ip_addr.family != IPADDR_INET4 &&
|
||||||
remote_addr->ip_addr.family != IPADDR_INET6) {
|
remote_addr->ip_addr.family != IPADDR_INET6)
|
||||||
*found = *slot = 0;
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
hash = UTI_IPToHash(&remote_addr->ip_addr);
|
hash = UTI_IPToHash(&remote_addr->ip_addr);
|
||||||
port = remote_addr->port;
|
port = remote_addr->port;
|
||||||
@@ -230,8 +231,6 @@ find_slot(NTP_Remote_Address *remote_addr, int *slot, int *found)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
*found = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ================================================== */
|
/* ================================================== */
|
||||||
|
|||||||
Reference in New Issue
Block a user