From: Marko Kreen Date: Fri, 13 Apr 2007 11:32:43 +0000 (+0000) Subject: remote bloat from strlcat X-Git-Tag: pgbouncer_1_0_7~7 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f65fa09f71a8a61253636f425e42e6d30f18a256;p=pgbouncer remote bloat from strlcat --- diff --git a/src/util.c b/src/util.c index 6f83421..9b9225d 100644 --- a/src/util.c +++ b/src/util.c @@ -40,7 +40,7 @@ void *zmalloc(size_t len) } /* - * Safe string copy + * Minimal spec-conforming implementations of strlcpy(), strlcat(). */ #ifndef HAVE_STRLCPY size_t strlcpy(char *dst, const char *src, size_t n) @@ -61,9 +61,7 @@ size_t strlcat(char *dst, const char *src, size_t n) size_t pos = 0; while (pos < n && dst[pos]) pos++; - if (pos < n) - return pos + strlcpy(dst + pos, src, n - pos); - return pos + strlen(src); + return pos + strlcpy(dst + pos, src, n - pos); } #endif