# HG changeset patch # User Francois Perrad # Date 1458889039 -3600 # Node ID 826a3293fe5ae76d520efe99c889376bc710f29b # Parent 2535ea9d0a6fb85566699a8b1fe7c86c66aeee92 upgrade strlcat in order to remove K&R code diff -r 2535ea9d0a6f -r 826a3293fe5a compat.c --- a/compat.c Thu Sep 15 21:43:57 2016 +0800 +++ b/compat.c Fri Mar 25 07:57:19 2016 +0100 @@ -114,8 +114,8 @@ #endif /* HAVE_STRLCPY */ #ifndef HAVE_STRLCAT -/* taken from openbsd-compat for OpenSSH 3.6.1p1 */ -/* "$OpenBSD: strlcat.c,v 1.8 2001/05/13 15:40:15 deraadt Exp $" +/* taken from openbsd-compat for OpenSSH 7.2p2 */ +/* "$OpenBSD: strlcat.c,v 1.13 2005/08/08 08:05:37 espie Exp $" * * Appends src to string dst of size siz (unlike strncat, siz is the * full size of dst, not space left). At most siz-1 characters @@ -123,15 +123,12 @@ * Returns strlen(src) + MIN(siz, strlen(initial dst)). * If retval >= siz, truncation occurred. */ - size_t -strlcat(dst, src, siz) - char *dst; - const char *src; - size_t siz; +size_t +strlcat(char *dst, const char *src, size_t siz) { - register char *d = dst; - register const char *s = src; - register size_t n = siz; + char *d = dst; + const char *s = src; + size_t n = siz; size_t dlen; /* Find the end of dst and adjust bytes left but don't go past end */