summaryrefslogtreecommitdiff
path: root/addrtostr.c
diff options
context:
space:
mode:
Diffstat (limited to 'addrtostr.c')
-rw-r--r--addrtostr.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/addrtostr.c b/addrtostr.c
index 1ea792ad..caea1775 100644
--- a/addrtostr.c
+++ b/addrtostr.c
@@ -188,12 +188,12 @@ addrtostr6 (const void *src, char *dst, size_t size)
*tp++ = ':';
*tp++ = '\0';
- /* Check for overflow, copy, and we're done.
+ /* Copy and check for overflow.
*/
- if ((size_t)(tp - tmp) > size)
+ if (strlcpy (dst, tmp, size) >= size)
{
errno = ENOSPC;
return (NULL);
}
- return strcpy (dst, tmp);
+ return (dst);
}