diff options
author | frosch <frosch@openttd.org> | 2014-04-23 20:44:42 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2014-04-23 20:44:42 +0000 |
commit | ef4c2ce0317ae583e837722b6a41ea44cd83da71 (patch) | |
tree | c0c3d77ac495a6b9257cd7de4dadc6712db1acc8 /src/string.cpp | |
parent | 56e8ea6ddef08eb6ad1a28d06dddecb902e1bc04 (diff) | |
download | openttd-ef4c2ce0317ae583e837722b6a41ea44cd83da71.tar.xz |
(svn r26485) -Codechange: Replace ttd_strlcpy and ttd_strlcat with strecpy and strecat.
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. |