>>>>> "MD" == Michael Douglass <[EMAIL PROTECTED]> writes:
MD> Notice that if len < HUGE_STRING_LEN; we REQUEST to write 'len' bytes,
MD> but we only write 'sent' bytes. If 0 < sent < len; then we iterate
MD> back over this while loop because len > 0 after the len -= sent command.
MD> On the next write, however, we are rewriting from the position the
MD> buffer had on the LAST write because the buffer was not incremented.
MD> Notice also, that if len >= HUGE_STRING_LEN that we are requesting
MD> to write HUGE_STRING_LEN bytes; but we only write 'sent' bytes. Now,
MD> if sent < HUGE_STRING_LEN, then we decrement our len by the correct
MD> number of bytes--but we increment our buffer HUGE_STRING_LEN - sent
MD> bytes beyond the correct position.
Both excellent catches. I agree with your reasoning and your fix.
I'll leave it to DougM to incorporate into the CVS tree, hopefully
soon!
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Vivek Khera, Ph.D. Khera Communications, Inc.
Internet: [EMAIL PROTECTED] Rockville, MD +1-301-545-6996
PGP & MIME spoken here http://www.kciLink.com/home/khera/