1
0
mirror of https://github.com/open-simh/simh.git synced 2026-01-25 19:57:36 +00:00

SCP: Static Analyzer cleanups suggested by Peter Schorn

This commit is contained in:
Mark Pizzolato
2013-12-27 07:08:17 -08:00
parent bf58edfaab
commit 2bb502ee64
2 changed files with 5 additions and 2 deletions

View File

@@ -334,7 +334,7 @@ else {
fixed[1] = NULL;
ips = fixed;
}
for (ip=ips; *ip != NULL; ++ip) {
for (ip=ips; (ip != NULL) && (*ip != NULL); ++ip) {
ai = (struct addrinfo *)calloc(1, sizeof(*ai));
if (NULL == ai) {
s_freeaddrinfo(result);
@@ -556,7 +556,7 @@ if ((host != NULL) && (host_len != 0))
if ((port != NULL) && (port_len != 0))
memset (port, 0, port_len);
if ((cptr == NULL) || (*cptr == 0)) {
if (((default_host == NULL) || (*default_host == 0)) && ((default_port == NULL) || (*default_port == 0)))
if (((default_host == NULL) || (*default_host == 0)) || ((default_port == NULL) || (*default_port == 0)))
return SCPE_ARG;
if ((strlen(default_host) >= host_len) || (strlen(default_port) >= port_len))
return SCPE_ARG; /* no room */