aboutsummaryrefslogtreecommitdiff
path: root/toys
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2019-01-25 08:26:47 -0600
committerRob Landley <rob@landley.net>2019-01-25 08:26:47 -0600
commita60d0bd0bfddc49238d33424f4848a3c8bc3dc3e (patch)
treeedf43f146b1c844b000d5063dbc6368d4ab89045 /toys
parentec3b378c036c5c63844f7345ec8b7da11447cf63 (diff)
downloadtoybox-a60d0bd0bfddc49238d33424f4848a3c8bc3dc3e.tar.gz
No real need to copy data into variables and do nothing else with it...
Diffstat (limited to 'toys')
-rw-r--r--toys/net/netcat.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/toys/net/netcat.c b/toys/net/netcat.c
index 57304f44..cd05dcf3 100644
--- a/toys/net/netcat.c
+++ b/toys/net/netcat.c
@@ -116,12 +116,8 @@ void netcat_main(void)
socklen_t len = sizeof(struct sockaddr_storage);
if (TT.s) {
- char* port = toybuf;
- struct addrinfo* bind_addr;
-
- sprintf(port, "%ld", TT.p);
- bind_addr = xgetaddrinfo(TT.s, port, family, type, 0, 0);
- sockfd = xbind(bind_addr);
+ sprintf(toybuf, "%ld", TT.p);
+ sockfd = xbind(xgetaddrinfo(TT.s, toybuf, family, type, 0, 0));
} else {
size_t bind_addrlen;