diff options
| author | mestre <> | 2019-01-10 12:44:54 +0000 |
|---|---|---|
| committer | mestre <> | 2019-01-10 12:44:54 +0000 |
| commit | 53a08038276bcb782cad1b1570869ebd51d96455 (patch) | |
| tree | 3bb39592b90d9d0a3543dc17df774e8ee4235675 /src/usr.bin/nc/socks.c | |
| parent | be7aa7380fd412c91bd7c0c0177d203244b15ce2 (diff) | |
| download | openbsd-53a08038276bcb782cad1b1570869ebd51d96455.tar.gz openbsd-53a08038276bcb782cad1b1570869ebd51d96455.tar.bz2 openbsd-53a08038276bcb782cad1b1570869ebd51d96455.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.c | 5 |
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; |
