Make the compiler stricter and tidy up code to make the subsequent errors and warnings go away

This commit is contained in:
Alex Young
2012-06-11 13:57:03 +01:00
parent 8825f86726
commit 25fc0969cf
19 changed files with 132 additions and 139 deletions

View File

@@ -90,3 +90,17 @@ int parse_acl(struct ip_and_mask (**out)[], int max, char **entries)
return max;
}
void parse_port( char *s_port, struct sockaddr_in *out )
{
NULLCHECK( s_port );
int raw_port;
raw_port = atoi( s_port );
if ( raw_port < 0 || raw_port > 65535 ) {
fatal( "Port number must be >= 0 and <= 65535" );
}
out->sin_port = htobe16( raw_port );
}