mirror of
https://github.com/curl/curl.git
synced 2026-08-25 02:53:32 +03:00
Fixed ftp support with uClibc due to differing inet_ntoa_r() behaviour.
This commit is contained in:
parent
9a5c21c16f
commit
efaf688650
6 changed files with 32 additions and 14 deletions
|
|
@ -56,8 +56,19 @@
|
|||
*/
|
||||
static const char *inet_ntop4 (const u_char *src, char *dst, size_t size)
|
||||
{
|
||||
#ifdef HAVE_INET_NTOA_R
|
||||
#if defined(HAVE_INET_NTOA_R_2_ARGS)
|
||||
const char *ptr;
|
||||
size_t len;
|
||||
curlassert(size >= 16);
|
||||
ptr = inet_ntoa_r(*(struct in_addr*)src, dst);
|
||||
len = strlen(ptr);
|
||||
memmove(dst, ptr, len);
|
||||
dst[len] = 0;
|
||||
return dst;
|
||||
|
||||
#elif defined(HAVE_INET_NTOA_R)
|
||||
return inet_ntoa_r(*(struct in_addr*)src, dst, size);
|
||||
|
||||
#else
|
||||
const char *addr = inet_ntoa(*(struct in_addr*)src);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue