summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorotto <>2005-02-08 15:26:23 +0000
committerotto <>2005-02-08 15:26:23 +0000
commit3273bfcfafdb256c9dbd7cbc504d9e52378982fd (patch)
treec3bbce5715367eb04077966f7668348a73f422cd
parenta7f629555d85050aa100f0d3319053e6f8f21bdb (diff)
downloadopenbsd-3273bfcfafdb256c9dbd7cbc504d9e52378982fd.tar.gz
openbsd-3273bfcfafdb256c9dbd7cbc504d9e52378982fd.tar.bz2
openbsd-3273bfcfafdb256c9dbd7cbc504d9e52378982fd.zip
Some extra strict warning cleanup. From Xin Li <delphij at FreeBSD
dot ORG> with a twist from myself. No binary change. ok djm@
-rw-r--r--src/usr.bin/nc/atomicio.c2
-rw-r--r--src/usr.bin/nc/netcat.c10
-rw-r--r--src/usr.bin/nc/socks.c15
3 files changed, 14 insertions, 13 deletions
diff --git a/src/usr.bin/nc/atomicio.c b/src/usr.bin/nc/atomicio.c
index 9e732904ad..151dde0cf6 100644
--- a/src/usr.bin/nc/atomicio.c
+++ b/src/usr.bin/nc/atomicio.c
@@ -40,7 +40,7 @@ atomicio(ssize_t (*f) (int, void *, size_t), int fd, void *_s, size_t n)
40 char *s = _s; 40 char *s = _s;
41 ssize_t res, pos = 0; 41 ssize_t res, pos = 0;
42 42
43 while (n > pos) { 43 while (n > (size_t)pos) {
44 res = (f) (fd, s + pos, n - pos); 44 res = (f) (fd, s + pos, n - pos);
45 switch (res) { 45 switch (res) {
46 case -1: 46 case -1:
diff --git a/src/usr.bin/nc/netcat.c b/src/usr.bin/nc/netcat.c
index 3c610b9913..0149008185 100644
--- a/src/usr.bin/nc/netcat.c
+++ b/src/usr.bin/nc/netcat.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: netcat.c,v 1.76 2004/12/10 16:51:31 hshoexer Exp $ */ 1/* $OpenBSD: netcat.c,v 1.77 2005/02/08 15:26:23 otto Exp $ */
2/* 2/*
3 * Copyright (c) 2001 Eric Jackson <ericj@monkey.org> 3 * Copyright (c) 2001 Eric Jackson <ericj@monkey.org>
4 * 4 *
@@ -86,8 +86,8 @@ void build_ports(char *);
86void help(void); 86void help(void);
87int local_listen(char *, char *, struct addrinfo); 87int local_listen(char *, char *, struct addrinfo);
88void readwrite(int); 88void readwrite(int);
89int remote_connect(char *, char *, struct addrinfo); 89int remote_connect(const char *, const char *, struct addrinfo);
90int socks_connect(char *, char *, struct addrinfo, char *, char *, 90int socks_connect(const char *, const char *, struct addrinfo, const char *, const char *,
91 struct addrinfo, int); 91 struct addrinfo, int);
92int udptest(int); 92int udptest(int);
93int unix_connect(char *); 93int unix_connect(char *);
@@ -104,7 +104,7 @@ main(int argc, char *argv[])
104 socklen_t len; 104 socklen_t len;
105 struct sockaddr_storage cliaddr; 105 struct sockaddr_storage cliaddr;
106 char *proxy; 106 char *proxy;
107 char *proxyhost = "", *proxyport = NULL; 107 const char *proxyhost = "", *proxyport = NULL;
108 struct addrinfo proxyhints; 108 struct addrinfo proxyhints;
109 109
110 ret = 1; 110 ret = 1;
@@ -452,7 +452,7 @@ unix_listen(char *path)
452 * port or source address if needed. Returns -1 on failure. 452 * port or source address if needed. Returns -1 on failure.
453 */ 453 */
454int 454int
455remote_connect(char *host, char *port, struct addrinfo hints) 455remote_connect(const char *host, const char *port, struct addrinfo hints)
456{ 456{
457 struct addrinfo *res, *res0; 457 struct addrinfo *res, *res0;
458 int s, error, x = 1; 458 int s, error, x = 1;
diff --git a/src/usr.bin/nc/socks.c b/src/usr.bin/nc/socks.c
index e7d35b601a..035898e7e6 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.9 2004/10/17 03:13:55 djm Exp $ */ 1/* $OpenBSD: socks.c,v 1.10 2005/02/08 15:26:23 otto Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1999 Niklas Hallqvist. All rights reserved. 4 * Copyright (c) 1999 Niklas Hallqvist. All rights reserved.
@@ -48,9 +48,9 @@
48#define SOCKS_IPV4 1 48#define SOCKS_IPV4 1
49 49
50 50
51int remote_connect(char *, char *, struct addrinfo); 51int remote_connect(const char *, const char *, struct addrinfo);
52int socks_connect(char *host, char *port, struct addrinfo hints, 52int socks_connect(const char *host, const char *port, struct addrinfo hints,
53 char *proxyhost, char *proxyport, struct addrinfo proxyhints, 53 const char *proxyhost, const char *proxyport, struct addrinfo proxyhints,
54 int socksv); 54 int socksv);
55 55
56static in_addr_t 56static in_addr_t
@@ -110,8 +110,9 @@ proxy_read_line(int fd, char *buf, int bufsz)
110} 110}
111 111
112int 112int
113socks_connect(char *host, char *port, struct addrinfo hints, 113socks_connect(const char *host, const char *port,
114 char *proxyhost, char *proxyport, struct addrinfo proxyhints, 114 struct addrinfo hints __attribute__ ((__unused__)),
115 const char *proxyhost, const char *proxyport, struct addrinfo proxyhints,
115 int socksv) 116 int socksv)
116{ 117{
117 int proxyfd, r; 118 int proxyfd, r;
@@ -208,7 +209,7 @@ socks_connect(char *host, char *port, struct addrinfo hints,
208 "CONNECT %s:%d HTTP/1.0\r\n\r\n", 209 "CONNECT %s:%d HTTP/1.0\r\n\r\n",
209 host, ntohs(serverport)); 210 host, ntohs(serverport));
210 } 211 }
211 if (r == -1 || r >= sizeof(buf)) 212 if (r == -1 || (size_t)r >= sizeof(buf))
212 errx (1, "hostname too long"); 213 errx (1, "hostname too long");
213 r = strlen(buf); 214 r = strlen(buf);
214 215