From 400201444fb6709ed400c4b0fcdd7dd9ba84d033 Mon Sep 17 00:00:00 2001 From: hniksic Date: Mon, 3 Dec 2001 09:31:23 -0800 Subject: [PATCH] [svn] Don't initialize TMPSTORE directly. Submitted by Andre Majorel. --- src/ChangeLog | 5 +++++ src/host.c | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index 3f6c3bee..39a9a87a 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2001-12-03 Andre Majorel + + * host.c (lookup_host): Don't initialize TMPSTORE directly because + it's not legal C. + 2001-12-03 Hrvoje Niksic * ftp-basic.c (ftp_port): Don't return HOSTERR if we fail getting diff --git a/src/host.c b/src/host.c index a769fd97..7285cfb6 100644 --- a/src/host.c +++ b/src/host.c @@ -224,7 +224,7 @@ lookup_host (const char *host, int silent) if ((int)addr != -1) { char tmpstore[IP4_ADDRESS_LENGTH]; - char *lst[] = { tmpstore, NULL }; + char *lst[2]; /* ADDR is defined to be in network byte order, which is what this returns, so we can just copy it to STORE_IP. However, @@ -238,6 +238,8 @@ lookup_host (const char *host, int silent) offset = 0; #endif memcpy (tmpstore, (char *)&addr + offset, IP4_ADDRESS_LENGTH); + lst[0] = tmpstore; + lst[1] = NULL; return address_list_new (lst); }