diff options
Diffstat (limited to 'src/string.cpp')
-rw-r--r-- | src/string.cpp | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/src/string.cpp b/src/string.cpp index 5b60979db..6f9e4e2f0 100644 --- a/src/string.cpp +++ b/src/string.cpp @@ -55,56 +55,6 @@ static int CDECL vseprintf(char *str, const char *last, const char *format, va_l * 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. - * - * Appends the source string to the destination string with respect of the * terminating null-character and and the last pointer to the last element * in the destination buffer. If the last pointer is set to NULL no * boundary check is performed. |