summaryrefslogtreecommitdiffstats
path: root/Utilities/cmcurl/strequal.c
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-06-27 20:44:08 (GMT)
committerBrad King <brad.king@kitware.com>2013-06-27 20:46:23 (GMT)
commite643e0259df0736022d484c68a6781c3a380dd06 (patch)
tree418389d17651ae40b59f4fb5cd6383c91cc4c95d /Utilities/cmcurl/strequal.c
parent5dd8c01429da90a7417b72f17e784cc98f70f57c (diff)
downloadCMake-e643e0259df0736022d484c68a6781c3a380dd06.zip
CMake-e643e0259df0736022d484c68a6781c3a380dd06.tar.gz
CMake-e643e0259df0736022d484c68a6781c3a380dd06.tar.bz2
cmcurl: Backport curl bug 1192 fix (#14250)
LLVM headers define strlcat as a macro rather than as a function. See upstream Curl issue: http://curl.haxx.se/bug/view.cgi?id=1192 It was addressed by removing use of strlcat altogether. Port the upstream fix to CMake's curl.
Diffstat (limited to 'Utilities/cmcurl/strequal.c')
-rw-r--r--Utilities/cmcurl/strequal.c42
1 files changed, 0 insertions, 42 deletions
diff --git a/Utilities/cmcurl/strequal.c b/Utilities/cmcurl/strequal.c
index 76ad524..83796f6 100644
--- a/Utilities/cmcurl/strequal.c
+++ b/Utilities/cmcurl/strequal.c
@@ -99,45 +99,3 @@ char *Curl_strcasestr(const char *haystack, const char *needle)
}
return NULL;
}
-
-#ifndef HAVE_STRLCAT
-/*
- * The strlcat() function appends the NUL-terminated string src to the end
- * of dst. It will append at most size - strlen(dst) - 1 bytes, NUL-termi-
- * nating the result.
- *
- * The strlcpy() and strlcat() functions return the total length of the
- * string they tried to create. For strlcpy() that means the length of src.
- * For strlcat() that means the initial length of dst plus the length of
- * src. While this may seem somewhat confusing it was done to make trunca-
- * tion detection simple.
- *
- *
- */
-size_t Curl_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 != '\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';
-
- return(dlen + (s - src)); /* count does not include NUL */
-}
-#endif