Re: bugs in printf(3)

2016-01-04 Thread Ingo Schwarze
Hi Todd, Todd C. Miller wrote on Mon, Dec 28, 2015 at 10:46:08AM -0700: > On Fri, 25 Dec 2015 00:30:29 +0100, Ingo Schwarze wrote: >> Besides, i don't see the point in messing with FILE flags at all >> in case of encoding errors. As opposed to fgetwc(3) and fputwc(3), >> the manual doesn't

Re: ferror in ntpd (Re: bugs in printf(3))

2015-12-29 Thread Todd C. Miller
On Tue, 29 Dec 2015 13:25:16 +0100, =?utf-8?Q?J=C3=A9r=C3=A9mie_Courr=C3=A8ges- Anglas?= wrote: > I think it makes sense to try to recover, so calling clearerr() is > needed. But as said by millert you can't rely on fprintf to set the > error indicator; the write might not be committed to disk,

Re: ferror in ntpd (Re: bugs in printf(3))

2015-12-29 Thread Jérémie Courrèges-Anglas
"Todd C. Miller" writes: > On Tue, 29 Dec 2015 13:25:16 +0100, > =?utf-8?Q?J=C3=A9r=C3=A9mie_Courr=C3=A8ges- > Anglas?= wrote: > >> I think it makes sense to try to recover, so calling clearerr() is >> needed. But as said by millert you can't rely on fprintf to set

Re: ferror in ntpd (Re: bugs in printf(3))

2015-12-29 Thread Sebastian Benoit
as jca@ says, the clearerr() should be out of the loop, so ok benno@ too. J??r??mie Courr??ges-Anglas(j...@wxcvbn.org) on 2015.12.29 19:18:55 +0100: > "Todd C. Miller" writes: > > > On Tue, 29 Dec 2015 13:25:16 +0100, > > =?utf-8?Q?J=C3=A9r=C3=A9mie_Courr=C3=A8ges- >

Re: ferror in ntpd (Re: bugs in printf(3))

2015-12-29 Thread Jérémie Courrèges-Anglas
Sebastian Benoit writes: > Todd C. Miller(todd.mil...@courtesan.com) on 2015.12.28 10:46:08 -0700: >> On Fri, 25 Dec 2015 00:30:29 +0100, Ingo Schwarze wrote: >> >> > Besides, i don't see the point in messing with FILE flags at all >> > in case of encoding errors. As opposed

Re: bugs in printf(3)

2015-12-28 Thread Todd C. Miller
On Fri, 25 Dec 2015 00:30:29 +0100, Ingo Schwarze wrote: > Besides, i don't see the point in messing with FILE flags at all > in case of encoding errors. As opposed to fgetwc(3) and fputwc(3), > the manual doesn't document this fiddling, and POSIX doesn't ask > for it. No other conversions in

ferror in ntpd (Re: bugs in printf(3))

2015-12-28 Thread Sebastian Benoit
Todd C. Miller(todd.mil...@courtesan.com) on 2015.12.28 10:46:08 -0700: > On Fri, 25 Dec 2015 00:30:29 +0100, Ingo Schwarze wrote: > > > Besides, i don't see the point in messing with FILE flags at all > > in case of encoding errors. As opposed to fgetwc(3) and fputwc(3), > > the manual doesn't

Re: bugs in printf(3)

2015-12-26 Thread Jérémie Courrèges-Anglas
Ingo Schwarze writes: > Fourth file, fourth broken file. > This is the worst bug found so far. > All i'm doing is grepping libc/stdio for "EILSEQ". > So far, every single instance i looked at was buggy. > > I think we should cvs rm libc. > The code quality just isn't up to

Re: bugs in printf(3)

2015-12-25 Thread Ingo Schwarze
Hi, more is broken in printf(3). Ingo Schwarze wrote on Fri, Dec 25, 2015 at 12:30:29AM +0100: > Fourth file, fourth broken file. > This is the worst bug found so far. [...] > When fprintf(fp, "...%ls...", ...) encounters an encoding error, > it trashes fp BEYOND REPAIR, clearing all FILE

bugs in printf(3)

2015-12-24 Thread Ingo Schwarze
Fourth file, fourth broken file. This is the worst bug found so far. All i'm doing is grepping libc/stdio for "EILSEQ". So far, every single instance i looked at was buggy. I think we should cvs rm libc. The code quality just isn't up to OpwnBSD standards. When fprintf(fp, "...%ls...", ...)