[hackers] [sbase] strlcat, strlcpy style || Hiltjo Posthuma

From: <git_AT_suckless.org>
Date: Sun, 01 Jun 2014 19:01:24 +0200

commit 2dbb69493249468aa9c9359cc5eb66c49239fd3c
Author: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
Date: Sun Jun 1 13:35:58 2014 +0200

    strlcat, strlcpy style
    
    Signed-off-by: Hiltjo Posthuma <hiltjo_AT_codemadness.org>

diff --git a/util/strlcat.c b/util/strlcat.c
index 5631195..c64b1c7 100644
--- a/util/strlcat.c
+++ b/util/strlcat.c
_AT_@ -20,32 +20,32 @@
 
 /*
  * 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
- * will be copied. Always NUL terminates (unless siz <= strlen(dst)).
+ * full size of dst, not space left). At most siz-1 characters
+ * will be copied. Always NUL terminates (unless siz <= strlen(dst)).
  * Returns strlen(src) + MIN(siz, strlen(initial dst)).
  * If retval >= siz, truncation occurred.
  */
 size_t
 strlcat(char *dst, const char *src, size_t 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 */
- while (n-- != 0 && *d != '
Received on Sun Jun 01 2014 - 19:01:24 CEST

This archive was generated by hypermail 2.3.0 : Sun Jun 01 2014 - 19:12:08 CEST