Date: Tue, 10 Mar 2009 23:00:47 +0100 From: =?ISO-8859-1?Q?G=E1bor_K=F6vesd=E1n?= <gabor@FreeBSD.org> To: Ed Schouten <ed@80386.nl> Cc: FreeBSD Hackers <freebsd-hackers@freebsd.org> Subject: Re: fgetc doubts Message-ID: <49B6E30F.7020205@FreeBSD.org> In-Reply-To: <20090310215512.GI31961@hoeg.nl> References: <49B6DC95.9070607@FreeBSD.org> <20090310215512.GI31961@hoeg.nl>
next in thread | previous in thread | raw e-mail | index | archive | help
Ed Schouten escribió: > * Gábor Kövesdán <gabor@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? > I tried to substitute everything with int, because fgetc can return some error code afaik, but using int didn't help. -- Gabor Kovesdan FreeBSD Volunteer EMAIL: gabor@FreeBSD.org .:|:. gabor@kovesdan.org WEB: http://people.FreeBSD.org/~gabor .:|:. http://kovesdan.org
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?49B6E30F.7020205>