Per> I'm rather sick now, so I may not be thinking too clearly, but Per> your patch seems wrong to me. I think something like the Per> following (untested) is right. Basically, `buflen' should be the Per> allocated size of `buffer', while `bufpos' is the number of bytes Per> written to it. I agree; I misread the code earlier. I'll test this and check it in. Tom