httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Stein <gst...@lyra.org>
Subject Re: PATCH: APR buffered I/O
Date Mon, 03 Apr 2000 21:21:59 GMT
Watch out for sign extension in ap_ungetc() !!

It is quite possible that somebody passes in \xFF and the assignment to
->ungetchar will sign-extend to -1.

The assignment should look something like:

  thefile->ungetchar = (unsigned char)ch;

Cheers,
-g


On Mon, 3 Apr 2000, Jon Travis wrote:

> Attached are some patches to get ungetc() working in APR for
> non-buffered
> file descriptors.  In addition, I believe I fixed a bug with the
> ap_fgets() under
> Unix (it looks like Win32 has it correct).  I have tested out all these
> changes,
> but please poke a careful eye into it anyway.. ;-)
> 
> Also, I noticed that ap_seek() has arguments in reverse order from what
> UNIX
> says that they should be.  Perhaps we should change this for consistancy
> sake?
> 
> -- Jon
> 
> 
> 

-- 
Greg Stein, http://www.lyra.org/




Mime
View raw message