fgetc doubts

Ed Schouten ed at 80386.nl
Tue Mar 10 14:55:14 PDT 2009


* Gábor Kövesdán <gabor at FreeBSD.org> wrote:
> Hello,
>
> I have a problem when reading files with fgetc when a 0xff character  
> comes. In my code the reading stops at that point as if EOF had been  
> reached, but that's not actually the case.
> The code is here:  
> http://p4web.freebsd.org/@md=d&cd=//&c=Nsd@//depot/projects/soc2008/gabor_textproc/grep/file.c?ac=64&rev1=40
> And the problem occurs in grep_fgetln() when the buffers is being filled in:
>            for (; i < bufsiz && !grep_feof(f); i++)
>                binbuf[i] = grep_fgetc(f);
>
> Thanks in advance,

Sign extension bug?

-- 
 Ed Schouten <ed at 80386.nl>
 WWW: http://80386.nl/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20090310/a0bdc00c/attachment.pgp


More information about the freebsd-hackers mailing list