aboutsummaryrefslogtreecommitdiffstats
path: root/socks.c
diff options
context:
space:
mode:
authorXin LI <delphij@FreeBSD.org>2010-10-18 19:44:45 +0000
committerXin LI <delphij@FreeBSD.org>2010-10-18 19:44:45 +0000
commitb46a1ee8f0756ffa8aff09939ad8c814b10b8931 (patch)
tree8415397977fff001bdafa8de341e9e4bff90a4ed /socks.c
parenta83f96f1936ee3800ae6434d9099592cbbbbb930 (diff)
downloadsrc-b46a1ee8f0756ffa8aff09939ad8c814b10b8931.tar.gz
src-b46a1ee8f0756ffa8aff09939ad8c814b10b8931.zip
Import nc from OpenBSD's OPENBSD_4_8 as of today.vendor/netcat/4.8
Notes
Notes: svn path=/vendor/netcat/dist/; revision=214028 svn path=/vendor/netcat/4.8/; revision=214029; tag=vendor/netcat/4.8
Diffstat (limited to 'socks.c')
-rw-r--r--socks.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/socks.c b/socks.c
index da7bd0c60e6d..b38dff741e19 100644
--- a/socks.c
+++ b/socks.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: socks.c,v 1.17 2006/09/25 04:51:20 ray Exp $ */
+/* $OpenBSD: socks.c,v 1.18 2010/04/20 07:26:35 nicm Exp $ */
/*
* Copyright (c) 1999 Niklas Hallqvist. All rights reserved.
@@ -167,11 +167,11 @@ socks_connect(const char *host, const char *port,
buf[2] = SOCKS_NOAUTH;
cnt = atomicio(vwrite, proxyfd, buf, 3);
if (cnt != 3)
- err(1, "write failed (%d/3)", cnt);
+ err(1, "write failed (%zu/3)", cnt);
cnt = atomicio(read, proxyfd, buf, 2);
if (cnt != 2)
- err(1, "read failed (%d/3)", cnt);
+ err(1, "read failed (%zu/3)", cnt);
if (buf[1] == SOCKS_NOMETHOD)
errx(1, "authentication method negotiation failed");
@@ -220,11 +220,11 @@ socks_connect(const char *host, const char *port,
cnt = atomicio(vwrite, proxyfd, buf, wlen);
if (cnt != wlen)
- err(1, "write failed (%d/%d)", cnt, wlen);
+ err(1, "write failed (%zu/%zu)", cnt, wlen);
cnt = atomicio(read, proxyfd, buf, 10);
if (cnt != 10)
- err(1, "read failed (%d/10)", cnt);
+ err(1, "read failed (%zu/10)", cnt);
if (buf[1] != 0)
errx(1, "connection failed, SOCKS error %d", buf[1]);
} else if (socksv == 4) {
@@ -242,11 +242,11 @@ socks_connect(const char *host, const char *port,
cnt = atomicio(vwrite, proxyfd, buf, wlen);
if (cnt != wlen)
- err(1, "write failed (%d/%d)", cnt, wlen);
+ err(1, "write failed (%zu/%zu)", cnt, wlen);
cnt = atomicio(read, proxyfd, buf, 8);
if (cnt != 8)
- err(1, "read failed (%d/8)", cnt);
+ err(1, "read failed (%zu/8)", cnt);
if (buf[1] != 90)
errx(1, "connection failed, SOCKS error %d", buf[1]);
} else if (socksv == -1) {
@@ -272,7 +272,7 @@ socks_connect(const char *host, const char *port,
cnt = atomicio(vwrite, proxyfd, buf, r);
if (cnt != r)
- err(1, "write failed (%d/%d)", cnt, r);
+ err(1, "write failed (%zu/%d)", cnt, r);
if (authretry > 1) {
char resp[1024];
@@ -290,7 +290,7 @@ socks_connect(const char *host, const char *port,
errx(1, "Proxy auth response too long");
r = strlen(buf);
if ((cnt = atomicio(vwrite, proxyfd, buf, r)) != r)
- err(1, "write failed (%d/%d)", cnt, r);
+ err(1, "write failed (%zu/%d)", cnt, r);
}
/* Terminate headers */