diff --git a/CHANGES b/CHANGES index d059101..65da1b3 100644 --- a/CHANGES +++ b/CHANGES @@ -14,6 +14,8 @@ Coding: Rearranged option group bits to only require 32 bits on older systems. + Make gcc happy, replace strncat with "manual" copying + ####################### V 1.7.4.5 (not released): Corrections: diff --git a/sysutils.c b/sysutils.c index b89e9a9..90b282f 100644 --- a/sysutils.c +++ b/sysutils.c @@ -192,9 +192,14 @@ char *sockaddr_info(const struct sockaddr *sa, socklen_t salen, char *buff, size switch (sau->soa.sa_family) { #if WITH_UNIX case 0: - case AF_UNIX: sockaddr_unix_info(&sau->un, salen, cp+1, blen-1); - cp[0] = '"'; - strncat(cp+1, "\"", 1); + case AF_UNIX: + *cp++ = '"'; --blen; + sockaddr_unix_info(&sau->un, salen, cp, blen-1); + blen -= strlen(cp); + cp = strchr(cp, '\0'); + *cp++ = '"'; --blen; + if (blen > 0) + *cp = '\0'; break; #endif #if WITH_IP4 @@ -513,12 +518,16 @@ int check_ipaddr( const char *address) { int res4, res6; +#if WITH_IP4 if ((res4 = check_ip4addr(address)) == 0) { return 0; } +#endif +#if WITH_IP6 if ((res6 = check_ip6addr(address)) == 0) { return 0; } +#endif return 1; }