[Libsysio-commit] HEAD: libsysio/src ioctx.c
Brought to you by:
lward
From: Lee W. <lw...@us...> - 2004-03-01 19:22:50
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11457 Modified Files: ioctx.c Log Message: Can't use returned character count in the overflow checks. That content is used later to adjust current xtvec and iovec. Use a temproary variable now. Index: ioctx.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/ioctx.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -w -b -B -p -r1.10 -r1.11 --- ioctx.c 26 Feb 2004 17:35:43 -0000 1.10 +++ ioctx.c 1 Mar 2004 19:03:46 -0000 1.11 @@ -338,7 +338,7 @@ _sysio_enumerate_extents(const struct in void *), void *arg) { - ssize_t acc, cc; + ssize_t acc, tmp, cc; struct iovec iovec; struct intnl_xtvec xtvec; const struct iovec *start; @@ -382,12 +382,12 @@ _sysio_enumerate_extents(const struct in return acc; return cc; } - cc += acc; - if (acc && cc <= acc) - abort(); /* paranoia */ - acc = cc; iovec.iov_base = (char *)iovec.iov_base + cc; iovec.iov_len -= cc; + tmp = cc + acc; + if (acc && tmp <= acc) + abort(); /* paranoia */ + acc = tmp; } else { start = iov; n = xtvec.xtv_len; @@ -419,10 +419,10 @@ _sysio_enumerate_extents(const struct in return cc; } remain -= cc; - cc += acc; - if (acc && cc <= acc) + tmp = cc + acc; + if (acc && tmp <= acc) abort(); /* paranoia */ - acc = cc; + acc = tmp; if (remain) return acc; /* short */ } |