1
0
mirror of https://github.com/simh/simh.git synced 2026-05-17 18:34:24 +00:00

FRONTPANEL: Cleanup potential build warnings

This commit is contained in:
Mark Pizzolato
2026-04-05 20:07:31 -10:00
parent abdc5318cb
commit 139dbe4f9a
2 changed files with 9 additions and 7 deletions

View File

@@ -163,6 +163,8 @@ typedef size_t socklen_t;
typedef int (WSAAPI *getnameinfo_func) (const struct sockaddr *sa, socklen_t salen, char *host, size_t hostlen, char *serv, size_t servlen, int flags);
static getnameinfo_func p_getnameinfo;
#if !defined(AF_INET6) || defined(TEST_INFO_STUBS) || defined(_WIN32)
static void WSAAPI s_freeaddrinfo (struct addrinfo *ai)
{
struct addrinfo *a, *an;
@@ -384,6 +386,8 @@ if ((host) && (hostlen > 0)) {
return 0;
}
#endif /* !defined(AF_INET6) || defined(TEST_INFO_STUBS) || defined(_WIN32) */
#if defined(_WIN32) || defined(__CYGWIN__)
#if !defined(IPV6_V6ONLY) /* Older XP environments may not define IPV6_V6ONLY */
@@ -675,7 +679,7 @@ if (c != NULL) {
bits = strtoul (c + 1, &c1, 10);
if ((bits == 0) || (bits > 128) || (*c1 != '\0'))
return status;
if ((c - validate_addr) > sizeof (v_cpy) - 1)
if ((size_t)(c - validate_addr) > sizeof (v_cpy) - 1)
return status;
memcpy (v_cpy, validate_addr, c - validate_addr); /* Copy everything before the / */
v_cpy[c - validate_addr] = '\0'; /* NUL terminate the result */
@@ -701,7 +705,7 @@ while ((*acl != '\0') && !done) {
permit = (*acl == '+');
cc = strchr (acl, ',');
if (cc != NULL) {
if ((cc - acl) > sizeof (rule))
if ((size_t)(cc - acl) > sizeof (rule))
break; /* Too big - error */
memcpy (rule, acl + 1, cc - (acl + 1));
rule[cc - (acl + 1)] = '\0';