aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2001-03-17 05:43:39 +0000
committerEric Andersen <andersen@codepoet.org>2001-03-17 05:43:39 +0000
commit8b960321393f0d9206fc09da80d3a277153d72db (patch)
tree5bca683ece823a520fdafae05e1b0016a7e3d255
parent341744781a3090774fe9dc8ef788a16e6c793c7b (diff)
downloadbusybox-8b960321393f0d9206fc09da80d3a277153d72db.tar.gz
Fix a bug pointed out by Rob Landley <rlandley@austin.rr.com>, where
setup_sockaddr_in was zeroing the sizeof a pointer, not the sizeof the struct, which was obviously what was intended. Thanks Rob, -Erik
-rw-r--r--networking/telnet.c2
-rw-r--r--telnet.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/networking/telnet.c b/networking/telnet.c
index 758cce8b1..d47bf699b 100644
--- a/networking/telnet.c
+++ b/networking/telnet.c
@@ -612,7 +612,7 @@ static int create_socket()
static void setup_sockaddr_in(struct sockaddr_in * addr, int port)
{
- memset(addr, 0, sizeof addr);
+ memset(addr, 0, sizeof(struct sockaddr_in));
addr->sin_family = AF_INET;
addr->sin_port = htons(port);
}
diff --git a/telnet.c b/telnet.c
index 758cce8b1..d47bf699b 100644
--- a/telnet.c
+++ b/telnet.c
@@ -612,7 +612,7 @@ static int create_socket()
static void setup_sockaddr_in(struct sockaddr_in * addr, int port)
{
- memset(addr, 0, sizeof addr);
+ memset(addr, 0, sizeof(struct sockaddr_in));
addr->sin_family = AF_INET;
addr->sin_port = htons(port);
}