summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2006-04-02 02:04:06 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2006-04-02 02:04:06 +0000
commit3c01c37065fdafbaa46e4fb69a2cda30da6d4a2b (patch)
tree0cc52f284a72a94fea126d29afa78055e2db4403 /lib
parent48210169bebec420976b4095f024e342838b29b2 (diff)
be more careful checking for (off_t)-1 as the failure condition from
lseek(), not just any old -1; ok millert
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/rpc/xdr_rec.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/libc/rpc/xdr_rec.c b/lib/libc/rpc/xdr_rec.c
index e8d9c264a48..0778955090e 100644
--- a/lib/libc/rpc/xdr_rec.c
+++ b/lib/libc/rpc/xdr_rec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xdr_rec.c,v 1.11 2005/08/08 08:05:36 espie Exp $ */
+/* $OpenBSD: xdr_rec.c,v 1.12 2006/04/02 02:04:05 deraadt Exp $ */
/*
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
* unrestricted use provided that this legend is included on all tape
@@ -285,10 +285,10 @@ static u_int
xdrrec_getpos(XDR *xdrs)
{
RECSTREAM *rstrm = (RECSTREAM *)xdrs->x_private;
- long pos;
+ off_t pos;
- pos = lseek((int)(long)rstrm->tcp_handle, (off_t)0, 1);
- if (pos != -1)
+ pos = lseek((int)(long)rstrm->tcp_handle, (off_t)0, SEEK_CUR);
+ if (pos != (off_t)-1)
switch (xdrs->x_op) {
case XDR_ENCODE: