From owner-freebsd-hackers@FreeBSD.ORG Tue Mar 10 21:55:13 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D8DB4106566B; Tue, 10 Mar 2009 21:55:13 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:7b8:613:100::211]) by mx1.freebsd.org (Postfix) with ESMTP id 73C808FC21; Tue, 10 Mar 2009 21:55:13 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: by palm.hoeg.nl (Postfix, from userid 1000) id 405E41CE0D; Tue, 10 Mar 2009 22:55:12 +0100 (CET) Date: Tue, 10 Mar 2009 22:55:12 +0100 From: Ed Schouten To: =?iso-8859-1?Q?G=E1bor_K=F6vesd=E1n?= Message-ID: <20090310215512.GI31961@hoeg.nl> References: <49B6DC95.9070607@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="cpvLTH7QU4gwfq3S" Content-Disposition: inline In-Reply-To: <49B6DC95.9070607@FreeBSD.org> User-Agent: Mutt/1.5.19 (2009-01-05) Cc: FreeBSD Hackers Subject: Re: fgetc doubts X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Mar 2009 21:55:14 -0000 --cpvLTH7QU4gwfq3S Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * G=E1bor K=F6vesd=E1n wrote: > Hello, > > I have a problem when reading files with fgetc when a 0xff character =20 > comes. In my code the reading stops at that point as if EOF had been =20 > reached, but that's not actually the case. > The code is here: =20 > http://p4web.freebsd.org/@md=3Dd&cd=3D//&c=3DNsd@//depot/projects/soc2008= /gabor_textproc/grep/file.c?ac=3D64&rev1=3D40 > And the problem occurs in grep_fgetln() when the buffers is being filled = in: > for (; i < bufsiz && !grep_feof(f); i++) > binbuf[i] =3D grep_fgetc(f); > > Thanks in advance, Sign extension bug? --=20 Ed Schouten WWW: http://80386.nl/ --cpvLTH7QU4gwfq3S Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkm24cAACgkQ52SDGA2eCwUtBwCdEsgo+GCh/s9IIz4Bo3Bb0UTz 7ogAniwJ7zFgftoYNVyZXhPZeLYxbg14 =Lwct -----END PGP SIGNATURE----- --cpvLTH7QU4gwfq3S--