]> granicus.if.org Git - pgbouncer/commitdiff
remote bloat from strlcat
authorMarko Kreen <markokr@gmail.com>
Fri, 13 Apr 2007 11:32:43 +0000 (11:32 +0000)
committerMarko Kreen <markokr@gmail.com>
Fri, 13 Apr 2007 11:32:43 +0000 (11:32 +0000)
src/util.c

index 6f83421baa9df63c474d58d67aa073ea19427c56..9b9225df6e42be12d612f7318e404e1aa92536b4 100644 (file)
@@ -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