adjusted the IPv6 stuff to compile and build on Linux as well

This commit is contained in:
Daniel Stenberg 2001-02-05 23:35:44 +00:00
parent f6e2bfd464
commit db70cd28b3
2 changed files with 35 additions and 5 deletions

View file

@ -66,3 +66,29 @@ int Curl_strnequal(const char *first, const char *second, size_t max)
#endif
}
#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 strlcat(char *dst, const char *src, size_t size)
{
size_t len = strlen(dst);
size_t orglen = len;
int index=0;
while(src[index] && (len < (size-1)) ) {
dst[len++] = src[index++];
}
dst[len]=0;
return orglen + strlen(src);
}
#endif