summaryrefslogtreecommitdiff
path: root/sys/lib
diff options
context:
space:
mode:
Diffstat (limited to 'sys/lib')
-rw-r--r--sys/lib/libsa/arp.c4
-rw-r--r--sys/lib/libsa/bootp.c4
-rw-r--r--sys/lib/libsa/ether.c8
-rw-r--r--sys/lib/libsa/exec.c34
-rw-r--r--sys/lib/libsa/net.c10
-rw-r--r--sys/lib/libsa/rarp.c4
-rw-r--r--sys/lib/libsa/rpc.c8
-rw-r--r--sys/lib/libsa/ufs.c6
8 files changed, 39 insertions, 39 deletions
diff --git a/sys/lib/libsa/arp.c b/sys/lib/libsa/arp.c
index 60f4c155b8d..46fd2d0003e 100644
--- a/sys/lib/libsa/arp.c
+++ b/sys/lib/libsa/arp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: arp.c,v 1.5 1996/12/08 15:15:45 niklas Exp $ */
+/* $OpenBSD: arp.c,v 1.6 1998/02/23 20:32:18 niklas Exp $ */
/* $NetBSD: arp.c,v 1.15 1996/10/13 02:28:58 christos Exp $ */
/*
@@ -183,7 +183,7 @@ arprecv(d, pkt, len, tleft)
n = readether(d, pkt, len, tleft, &etype);
errno = 0; /* XXX */
- if (n == -1 || n < sizeof(struct ether_arp)) {
+ if (n < 0 || (size_t)n < sizeof(struct ether_arp)) {
#ifdef ARP_DEBUG
if (debug)
printf("bad len=%d\n", n);
diff --git a/sys/lib/libsa/bootp.c b/sys/lib/libsa/bootp.c
index 144dc26ae27..2e073d23f66 100644
--- a/sys/lib/libsa/bootp.c
+++ b/sys/lib/libsa/bootp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bootp.c,v 1.6 1996/12/08 15:15:46 niklas Exp $ */
+/* $OpenBSD: bootp.c,v 1.7 1998/02/23 20:32:21 niklas Exp $ */
/* $NetBSD: bootp.c,v 1.10 1996/10/13 02:28:59 christos Exp $ */
/*
@@ -160,7 +160,7 @@ bootprecv(d, pkt, len, tleft)
#endif
n = readudp(d, pkt, len, tleft);
- if (n == -1 || n < sizeof(struct bootp))
+ if (n < 0 || (size_t)n < sizeof(struct bootp))
goto bad;
bp = (struct bootp *)pkt;
diff --git a/sys/lib/libsa/ether.c b/sys/lib/libsa/ether.c
index c298ca423e0..b8c9bc4206d 100644
--- a/sys/lib/libsa/ether.c
+++ b/sys/lib/libsa/ether.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ether.c,v 1.4 1996/12/08 15:15:49 niklas Exp $ */
+/* $OpenBSD: ether.c,v 1.5 1998/02/23 20:32:23 niklas Exp $ */
/* $NetBSD: ether.c,v 1.8 1996/10/13 02:29:00 christos Exp $ */
/*
@@ -79,7 +79,7 @@ sendether(d, pkt, len, dea, etype)
eh->ether_type = htons(etype);
n = netif_put(d, eh, len);
- if (n == -1 || n < sizeof(*eh))
+ if (n < 0 || (size_t)n < sizeof(*eh))
return (-1);
n -= sizeof(*eh);
@@ -111,7 +111,7 @@ readether(d, pkt, len, tleft, etype)
len += sizeof(*eh);
n = netif_get(d, eh, len, tleft);
- if (n == -1 || n < sizeof(*eh))
+ if (n < 0 || (size_t)n < sizeof(*eh))
return (-1);
/* Validate Ethernet address. */
@@ -138,7 +138,7 @@ char *
ether_sprintf(ap)
register u_char *ap;
{
- register i;
+ register int i;
static char etherbuf[18];
register char *cp = etherbuf;
diff --git a/sys/lib/libsa/exec.c b/sys/lib/libsa/exec.c
index 9d769d496a9..84bc3cdcee1 100644
--- a/sys/lib/libsa/exec.c
+++ b/sys/lib/libsa/exec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: exec.c,v 1.18 1997/09/28 22:46:02 weingart Exp $ */
+/* $OpenBSD: exec.c,v 1.19 1998/02/23 20:32:25 niklas Exp $ */
/* $NetBSD: exec.c,v 1.15 1996/10/13 02:29:01 christos Exp $ */
/*-
@@ -58,7 +58,8 @@ exec(path, loadaddr, howto)
struct stat sb;
#endif
struct exec x;
- int i;
+ u_int i;
+ ssize_t sz;
char *addr;
#ifdef EXEC_DEBUG
char *daddr, *etxt;
@@ -72,9 +73,8 @@ exec(path, loadaddr, howto)
if (sb.st_mode & 2)
printf("non-secure file, check permissions!\n");
- i = read(io, (char *)&x, sizeof(x));
- if (i != sizeof(x) ||
- N_BADMAG(x)) {
+ sz = read(io, (char *)&x, sizeof(x));
+ if (sz != sizeof(x) || N_BADMAG(x)) {
errno = EFTYPE;
return;
}
@@ -88,15 +88,15 @@ exec(path, loadaddr, howto)
/* Text */
printf("%ld", x.a_text);
addr = loadaddr;
- i = x.a_text;
+ sz = x.a_text;
if (N_GETMAGIC(x) == ZMAGIC) {
bcopy((char *)&x, addr, sizeof x);
addr += sizeof x;
- i -= sizeof x;
+ sz -= sizeof x;
}
- if (read(io, (char *)addr, i) != i)
+ if (read(io, (char *)addr, sz) != sz)
goto shread;
- addr += i;
+ addr += sz;
#ifdef EXEC_DEBUG
printf("\ntext {%x, %x, %x, %x}\n",
addr[0], addr[1], addr[2], addr[3]);
@@ -111,7 +111,7 @@ exec(path, loadaddr, howto)
daddr = addr;
#endif
printf("+%ld", x.a_data);
- if (read(io, addr, x.a_data) != x.a_data)
+ if (read(io, addr, x.a_data) != (ssize_t)x.a_data)
goto shread;
addr += x.a_data;
@@ -126,24 +126,24 @@ exec(path, loadaddr, howto)
bcopy(&x.a_syms, addr, sizeof(x.a_syms));
addr += sizeof(x.a_syms);
printf("+[%ld", x.a_syms);
- if (read(io, addr, x.a_syms) != x.a_syms)
+ if (read(io, addr, x.a_syms) != (ssize_t)x.a_syms)
goto shread;
addr += x.a_syms;
- if (read(io, &i, sizeof(int)) != sizeof(int))
+ if (read(io, &i, sizeof(u_int)) != sizeof(u_int))
goto shread;
- bcopy(&i, addr, sizeof(int));
+ bcopy(&i, addr, sizeof(u_int));
if (i) {
- i -= sizeof(int);
+ sz = i - sizeof(int);
addr += sizeof(int);
- if (read(io, addr, i) != i)
+ if (read(io, addr, sz) != sz)
goto shread;
- addr += i;
+ addr += sz;
}
/* and that many bytes of string table */
- printf("+%d]", i);
+ printf("+%d]", sz);
esym = addr;
} else {
ssym = 0;
diff --git a/sys/lib/libsa/net.c b/sys/lib/libsa/net.c
index 65795b1a0ee..dd6bb231a67 100644
--- a/sys/lib/libsa/net.c
+++ b/sys/lib/libsa/net.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: net.c,v 1.8 1997/05/05 02:49:49 millert Exp $ */
+/* $OpenBSD: net.c,v 1.9 1998/02/23 20:32:27 niklas Exp $ */
/* $NetBSD: net.c,v 1.14 1996/10/13 02:29:02 christos Exp $ */
/*
@@ -117,9 +117,9 @@ sendudp(d, pkt, len)
ea = arpwhohas(d, gateip);
cc = sendether(d, ip, len, ea, ETHERTYPE_IP);
- if (cc == -1)
+ if (cc < 0)
return (-1);
- if (cc != len)
+ if ((size_t)cc != len)
panic("sendudp: bad write (%d != %d)", cc, len);
return (cc - (sizeof(*ip) + sizeof(*uh)));
}
@@ -152,7 +152,7 @@ readudp(d, pkt, len, tleft)
ip = (struct ip *)uh - 1;
n = readether(d, ip, len + sizeof(*ip) + sizeof(*uh), tleft, &etype);
- if (n == -1 || n < sizeof(*ip) + sizeof(*uh))
+ if (n < 0 || (size_t)n < sizeof(*ip) + sizeof(*uh))
return -1;
/* Ethernet address checks now in readether() */
@@ -304,7 +304,7 @@ sendrecv(d, sproc, sbuf, ssize, rproc, rbuf, rsize)
return -1;
}
cc = (*sproc)(d, sbuf, ssize);
- if (cc == -1 || cc < ssize)
+ if (cc < 0 || (size_t)cc < ssize)
panic("sendrecv: short write! (%d < %d)",
cc, ssize);
diff --git a/sys/lib/libsa/rarp.c b/sys/lib/libsa/rarp.c
index 23196ecf769..0f24ebbfbed 100644
--- a/sys/lib/libsa/rarp.c
+++ b/sys/lib/libsa/rarp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rarp.c,v 1.5 1996/12/08 15:15:55 niklas Exp $ */
+/* $OpenBSD: rarp.c,v 1.6 1998/02/23 20:32:28 niklas Exp $ */
/* $NetBSD: rarp.c,v 1.13 1996/10/13 02:29:05 christos Exp $ */
/*
@@ -168,7 +168,7 @@ rarprecv(d, pkt, len, tleft)
n = readether(d, pkt, len, tleft, &etype);
errno = 0; /* XXX */
- if (n == -1 || n < sizeof(struct ether_arp)) {
+ if (n < 0 || (size_t)n < sizeof(struct ether_arp)) {
#ifdef RARP_DEBUG
if (debug)
printf("bad len=%d\n", n);
diff --git a/sys/lib/libsa/rpc.c b/sys/lib/libsa/rpc.c
index 38c85b2b1a0..18af4b156d0 100644
--- a/sys/lib/libsa/rpc.c
+++ b/sys/lib/libsa/rpc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rpc.c,v 1.9 1997/02/06 19:35:52 mickey Exp $ */
+/* $OpenBSD: rpc.c,v 1.10 1998/02/23 20:32:30 niklas Exp $ */
/* $NetBSD: rpc.c,v 1.16 1996/10/13 02:29:06 christos Exp $ */
/*
@@ -190,10 +190,10 @@ rpc_call(d, prog, vers, proc, sdata, slen, rdata, rlen)
if (debug)
printf("callrpc: cc=%d rlen=%d\n", cc, rlen);
#endif
- if (cc == -1)
+ if (cc < -1)
return (-1);
- if (cc <= sizeof(*reply)) {
+ if ((size_t)cc <= sizeof(*reply)) {
errno = EBADRPC;
return (-1);
}
@@ -426,7 +426,7 @@ rpc_getport(d, prog, vers)
cc = rpc_call(d, PMAPPROG, PMAPVERS, PMAPPROC_GETPORT,
args, sizeof(*args), res, sizeof(*res));
- if (cc < sizeof(*res)) {
+ if (cc < 0 || (size_t)cc < sizeof(*res)) {
printf("getport: %s", strerror(errno));
errno = EBADRPC;
return (-1);
diff --git a/sys/lib/libsa/ufs.c b/sys/lib/libsa/ufs.c
index b2e67020c85..465c2d73ef5 100644
--- a/sys/lib/libsa/ufs.c
+++ b/sys/lib/libsa/ufs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ufs.c,v 1.11 1997/04/02 05:28:30 mickey Exp $ */
+/* $OpenBSD: ufs.c,v 1.12 1998/02/23 20:32:31 niklas Exp $ */
/* $NetBSD: ufs.c,v 1.16 1996/09/30 16:01:22 ws Exp $ */
/*-
@@ -129,7 +129,7 @@ read_inode(inumber, f)
buf, &rsize);
if (rc)
goto out;
- if (rsize != fs->fs_bsize) {
+ if (rsize != (size_t)fs->fs_bsize) {
rc = EIO;
goto out;
}
@@ -241,7 +241,7 @@ block_map(f, file_block, disk_block_p)
&fp->f_blksize[level]);
if (rc)
return (rc);
- if (fp->f_blksize[level] != fs->fs_bsize)
+ if (fp->f_blksize[level] != (size_t)fs->fs_bsize)
return (EIO);
fp->f_blkno[level] = ind_block_num;
}