From ef4c2ce0317ae583e837722b6a41ea44cd83da71 Mon Sep 17 00:00:00 2001 From: frosch Date: Wed, 23 Apr 2014 20:44:42 +0000 Subject: (svn r26485) -Codechange: Replace ttd_strlcpy and ttd_strlcat with strecpy and strecat. --- src/string.cpp | 50 -------------------------------------------------- 1 file changed, 50 deletions(-) (limited to 'src/string.cpp') diff --git a/src/string.cpp b/src/string.cpp index 5b60979db..6f9e4e2f0 100644 --- a/src/string.cpp +++ b/src/string.cpp @@ -51,56 +51,6 @@ static int CDECL vseprintf(char *str, const char *last, const char *format, va_l return min((int)diff, vsnprintf(str, diff + 1, format, ap)); } -/** - * Appends characters from one string to another. - * - * Appends the source string to the destination string with respect of the - * terminating null-character and the maximum size of the destination - * buffer. - * - * @note usage ttd_strlcat(dst, src, lengthof(dst)); - * @note lengthof() applies only to fixed size arrays - * - * @param dst The buffer containing the target string - * @param src The buffer containing the string to append - * @param size The maximum size of the destination buffer - */ -void ttd_strlcat(char *dst, const char *src, size_t size) -{ - assert(size > 0); - while (size > 0 && *dst != '\0') { - size--; - dst++; - } - - ttd_strlcpy(dst, src, size); -} - - -/** - * Copies characters from one buffer to another. - * - * Copies the source string to the destination buffer with respect of the - * terminating null-character and the maximum size of the destination - * buffer. - * - * @note usage ttd_strlcpy(dst, src, lengthof(dst)); - * @note lengthof() applies only to fixed size arrays - * - * @param dst The destination buffer - * @param src The buffer containing the string to copy - * @param size The maximum size of the destination buffer - */ -void ttd_strlcpy(char *dst, const char *src, size_t size) -{ - assert(size > 0); - while (--size > 0 && *src != '\0') { - *dst++ = *src++; - } - *dst = '\0'; -} - - /** * Appends characters from one string to another. * -- cgit v1.2.3-54-g00ecf