diff options
author | Eric Andersen <andersen@codepoet.org> | 2001-03-21 07:34:27 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2001-03-21 07:34:27 +0000 |
commit | 1ca20a77476fb69e2472080ef6ba23c8c0ad12ad (patch) | |
tree | d1f07be4de0004fe5e30b44320e10285147e7944 /networking/wget.c | |
parent | 7447642a47c6a0aefd05f4acf730950a510634cd (diff) | |
download | busybox-w32-1ca20a77476fb69e2472080ef6ba23c8c0ad12ad.tar.gz busybox-w32-1ca20a77476fb69e2472080ef6ba23c8c0ad12ad.tar.bz2 busybox-w32-1ca20a77476fb69e2472080ef6ba23c8c0ad12ad.zip |
A nice patch from Larry Doolittle that adds -Wshadow and
cleans up most of the now-revealed problems.
Diffstat (limited to 'networking/wget.c')
-rw-r--r-- | networking/wget.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/networking/wget.c b/networking/wget.c index 85023f977..f62d835e5 100644 --- a/networking/wget.c +++ b/networking/wget.c | |||
@@ -291,24 +291,24 @@ void parse_url(char *url, char **uri_host, int *uri_port, char **uri_path) | |||
291 | 291 | ||
292 | FILE *open_socket(char *host, int port) | 292 | FILE *open_socket(char *host, int port) |
293 | { | 293 | { |
294 | struct sockaddr_in sin; | 294 | struct sockaddr_in s_in; |
295 | struct hostent *hp; | 295 | struct hostent *hp; |
296 | int fd; | 296 | int fd; |
297 | FILE *fp; | 297 | FILE *fp; |
298 | 298 | ||
299 | memset(&sin, 0, sizeof(sin)); | 299 | memset(&s_in, 0, sizeof(s_in)); |
300 | sin.sin_family = AF_INET; | 300 | s_in.sin_family = AF_INET; |
301 | if ((hp = (struct hostent *) gethostbyname(host)) == NULL) | 301 | if ((hp = (struct hostent *) gethostbyname(host)) == NULL) |
302 | error_msg_and_die("cannot resolve %s", host); | 302 | error_msg_and_die("cannot resolve %s", host); |
303 | memcpy(&sin.sin_addr, hp->h_addr_list[0], hp->h_length); | 303 | memcpy(&s_in.sin_addr, hp->h_addr_list[0], hp->h_length); |
304 | sin.sin_port = htons(port); | 304 | s_in.sin_port = htons(port); |
305 | 305 | ||
306 | /* | 306 | /* |
307 | * Get the server onto a stdio stream. | 307 | * Get the server onto a stdio stream. |
308 | */ | 308 | */ |
309 | if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) | 309 | if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) |
310 | perror_msg_and_die("socket()"); | 310 | perror_msg_and_die("socket()"); |
311 | if (connect(fd, (struct sockaddr *) &sin, sizeof(sin)) < 0) | 311 | if (connect(fd, (struct sockaddr *) &s_in, sizeof(s_in)) < 0) |
312 | perror_msg_and_die("connect(%s)", host); | 312 | perror_msg_and_die("connect(%s)", host); |
313 | if ((fp = fdopen(fd, "r+")) == NULL) | 313 | if ((fp = fdopen(fd, "r+")) == NULL) |
314 | perror_msg_and_die("fdopen()"); | 314 | perror_msg_and_die("fdopen()"); |
@@ -534,7 +534,7 @@ progressmeter(int flag) | |||
534 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 534 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
535 | * SUCH DAMAGE. | 535 | * SUCH DAMAGE. |
536 | * | 536 | * |
537 | * $Id: wget.c,v 1.29 2001/03/09 21:24:12 andersen Exp $ | 537 | * $Id: wget.c,v 1.30 2001/03/21 07:34:26 andersen Exp $ |
538 | */ | 538 | */ |
539 | 539 | ||
540 | 540 | ||