aboutsummaryrefslogtreecommitdiff
path: root/lib/ftp.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2002-01-04 09:17:52 +0000
committerDaniel Stenberg <daniel@haxx.se>2002-01-04 09:17:52 +0000
commit17a8bf212f26ba17d14a6e00048ab6f15b4baf89 (patch)
tree31d64d853fb1ae9f5f2fe665719e33f587ca6904 /lib/ftp.c
parent4fc76afef41ae040491460ea243bae2105396ad5 (diff)
The buffer in ftp_pasv_verbose(), used for gethostbyaddr_r(), is now defined
to become properly 8-byte aligned on 64-bit archs. Philip Gladstone reported.
Diffstat (limited to 'lib/ftp.c')
-rw-r--r--lib/ftp.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/ftp.c b/lib/ftp.c
index 56449f6a4..0ac5d4d2b 100644
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -861,13 +861,17 @@ ftp_pasv_verbose(struct connectdata *conn,
#ifdef HAVE_INET_NTOA_R
char ntoa_buf[64];
#endif
- char hostent_buf[9000];
+ /* The array size trick below is to make this a large chunk of memory
+ suitably 8-byte aligned on 64-bit platforms. This was thoughtfully
+ suggested by Philip Gladstone. */
+ long bigbuf[9000 / sizeof(long)];
#if defined(HAVE_INET_ADDR)
in_addr_t address;
# if defined(HAVE_GETHOSTBYADDR_R)
int h_errnop;
# endif
+ char *hostent_buf = (char *)bigbuf; /* get a char * to the buffer */
address = inet_addr(newhost);
# ifdef HAVE_GETHOSTBYADDR_R