diff options
author | 2006-04-02 02:04:05 +0000 | |
---|---|---|
committer | 2006-04-02 02:04:05 +0000 | |
commit | 45e991d9681f81863cf92fc08652e5ea473ab853 (patch) | |
tree | e079d9f46019cb520e82d9a99d7020dde45e5c26 /lib | |
parent | spacing; (diff) | |
download | wireguard-openbsd-45e991d9681f81863cf92fc08652e5ea473ab853.tar.xz wireguard-openbsd-45e991d9681f81863cf92fc08652e5ea473ab853.zip |
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.c | 8 |
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: |