Replaced strncat with manual copying

This commit is contained in:
Gerhard Rieger 2023-06-24 08:24:29 +02:00
parent c01722ac3e
commit 779473f667
2 changed files with 14 additions and 3 deletions

View file

@ -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:

View file

@ -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;
}