summaryrefslogtreecommitdiff
path: root/src/usr.bin/nc/socks.c
diff options
context:
space:
mode:
authormestre <>2019-01-10 12:44:54 +0000
committermestre <>2019-01-10 12:44:54 +0000
commit7d5ad0e66b7cd66e61d1d75f07f57890307a72f6 (patch)
tree3bb39592b90d9d0a3543dc17df774e8ee4235675 /src/usr.bin/nc/socks.c
parent387ee612b4875f4548b64da3172c09277a87bd66 (diff)
downloadopenbsd-7d5ad0e66b7cd66e61d1d75f07f57890307a72f6.tar.gz
openbsd-7d5ad0e66b7cd66e61d1d75f07f57890307a72f6.tar.bz2
openbsd-7d5ad0e66b7cd66e61d1d75f07f57890307a72f6.zip
Revert back previous commit and stop including strings.h
Use memset(3) instead of bzero(3) since POSIX recommends using the former and because it's also more portable (conforms to ANSI C standard) OK tedu@ tb@
Diffstat (limited to 'src/usr.bin/nc/socks.c')
-rw-r--r--src/usr.bin/nc/socks.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/usr.bin/nc/socks.c b/src/usr.bin/nc/socks.c
index 2855f18536..856c3e7446 100644
--- a/src/usr.bin/nc/socks.c
+++ b/src/usr.bin/nc/socks.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: socks.c,v 1.26 2019/01/09 12:58:18 inoguchi Exp $ */ 1/* $OpenBSD: socks.c,v 1.27 2019/01/10 12:44:54 mestre Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1999 Niklas Hallqvist. All rights reserved. 4 * Copyright (c) 1999 Niklas Hallqvist. All rights reserved.
@@ -36,7 +36,6 @@
36#include <stdio.h> 36#include <stdio.h>
37#include <stdlib.h> 37#include <stdlib.h>
38#include <string.h> 38#include <string.h>
39#include <strings.h>
40#include <unistd.h> 39#include <unistd.h>
41#include <resolv.h> 40#include <resolv.h>
42#include <readpassphrase.h> 41#include <readpassphrase.h>
@@ -66,7 +65,7 @@ decode_addrport(const char *h, const char *p, struct sockaddr *addr,
66 int r; 65 int r;
67 struct addrinfo hints, *res; 66 struct addrinfo hints, *res;
68 67
69 bzero(&hints, sizeof(hints)); 68 memset(&hints, 0, sizeof(hints));
70 hints.ai_family = v4only ? PF_INET : PF_UNSPEC; 69 hints.ai_family = v4only ? PF_INET : PF_UNSPEC;
71 hints.ai_flags = numeric ? AI_NUMERICHOST : 0; 70 hints.ai_flags = numeric ? AI_NUMERICHOST : 0;
72 hints.ai_socktype = SOCK_STREAM; 71 hints.ai_socktype = SOCK_STREAM;