
cherokee at cherokee-project
Sep 13, 2009, 4:48 PM
Post #1 of 1
(208 views)
Permalink
|
|
[3659] cherokee/trunk/cherokee: Removes "cherokee_strlcat" function.
|
|
Revision: 3659 http://svn.cherokee-project.com/changeset/3659 Author: aperez Date: 2009-09-14 01:48:41 +0200 (Mon, 14 Sep 2009) Log Message: ----------- Removes "cherokee_strlcat" function. "strlcat" is defined when it is not present in the system. Modified Paths: -------------- cherokee/trunk/cherokee/md5crypt.c cherokee/trunk/cherokee/util.c cherokee/trunk/cherokee/util.h Modified: cherokee/trunk/cherokee/md5crypt.c =================================================================== --- cherokee/trunk/cherokee/md5crypt.c 2009-09-12 14:50:12 UTC (rev 3658) +++ cherokee/trunk/cherokee/md5crypt.c 2009-09-13 23:48:41 UTC (rev 3659) @@ -168,17 +168,17 @@ p = passwd + strlen(passwd); l = (final[ 0]<<16) | (final[ 6]<<8) | final[12]; - cherokee_strlcat (passwd, to64(to64_buf, l, 4), MD5CRYPT_PASSWD_LEN); + strlcat (passwd, to64(to64_buf, l, 4), MD5CRYPT_PASSWD_LEN); l = (final[ 1]<<16) | (final[ 7]<<8) | final[13]; - cherokee_strlcat (passwd, to64(to64_buf, l, 4), MD5CRYPT_PASSWD_LEN); + strlcat (passwd, to64(to64_buf, l, 4), MD5CRYPT_PASSWD_LEN); l = (final[ 2]<<16) | (final[ 8]<<8) | final[14]; - cherokee_strlcat (passwd, to64(to64_buf, l, 4), MD5CRYPT_PASSWD_LEN); + strlcat (passwd, to64(to64_buf, l, 4), MD5CRYPT_PASSWD_LEN); l = (final[ 3]<<16) | (final[ 9]<<8) | final[15]; - cherokee_strlcat (passwd, to64(to64_buf, l, 4), MD5CRYPT_PASSWD_LEN); + strlcat (passwd, to64(to64_buf, l, 4), MD5CRYPT_PASSWD_LEN); l = (final[ 4]<<16) | (final[10]<<8) | final[ 5]; - cherokee_strlcat (passwd, to64(to64_buf, l, 4), MD5CRYPT_PASSWD_LEN); + strlcat (passwd, to64(to64_buf, l, 4), MD5CRYPT_PASSWD_LEN); l = final[11] ; - cherokee_strlcat (passwd, to64(to64_buf, l, 2), MD5CRYPT_PASSWD_LEN); + strlcat (passwd, to64(to64_buf, l, 2), MD5CRYPT_PASSWD_LEN); /* Don't leave anything around in vm they could use. */ Modified: cherokee/trunk/cherokee/util.c =================================================================== --- cherokee/trunk/cherokee/util.c 2009-09-12 14:50:12 UTC (rev 3658) +++ cherokee/trunk/cherokee/util.c 2009-09-13 23:48:41 UTC (rev 3659) @@ -293,52 +293,18 @@ #endif + +/* The following few lines has been copy and pasted from Todd + * C. Miller <Todd.Miller [at] courtesan> code. BSD licensed. + */ + /* 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)). * Returns strlen(src) + MIN(siz, strlen(initial dst)). * If retval >= siz, truncation occurred. */ -size_t -cherokee_strlcat (char *dst, const char *src, size_t siz) -{ -#ifdef HAVE_STRLCAT - return strlcat (dst, src, siz); -#else - /* The following few lines has been copy and pasted from Todd - * C. Miller <Todd.Miller [at] courtesan> code. BSD licensed. - */ - register char *d = dst; - register const char *s = src; - register size_t n = siz; - size_t dlen; - /* Find the end of dst and adjust bytes left but do not go - * past end. - */ - while (n-- != 0 && *d != '\0') - d++; - dlen = d - dst; - n = siz - dlen; - - if (n == 0) - return(dlen + strlen(s)); - while (*s != '\0') { - if (n != 1) { - *d++ = *s; - n--; - } - s++; - } - *d = '\0'; - - /* Count does not include NUL - */ - return(dlen + (s - src)); -#endif -} - - #ifndef HAVE_STRLCAT size_t strlcat (char *dst, const char *src, size_t siz) Modified: cherokee/trunk/cherokee/util.h =================================================================== --- cherokee/trunk/cherokee/util.h 2009-09-12 14:50:12 UTC (rev 3658) +++ cherokee/trunk/cherokee/util.h 2009-09-13 23:48:41 UTC (rev 3659) @@ -104,7 +104,6 @@ int cherokee_isbigendian (void); char *cherokee_min_str (char *s1, char *s2); char *cherokee_max_str (char *s1, char *s2); -size_t cherokee_strlcat (char *dst, const char *src, size_t siz); int cherokee_estimate_va_length (const char *format, va_list ap); long cherokee_eval_formated_time (cherokee_buffer_t *buf); ret_t cherokee_fix_dirpath (cherokee_buffer_t *buf);
|