This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] CHECK_INIT() before _flockfile() for scanf/fscanf


On Jul 14 20:14, Matt Johnson wrote:
> Hi all,
>     I noticed a mailing list thread and commit from 2005 here
> http://sourceware.org/ml/newlib/2005/msg00088.html where some stdio
> functions were calling _flockfile() on a FILE * before initializing
> it.  I think scanf/fscanf may have been missed by this initial
> patch; in the version of newlib I have (latest release), scanf() and
> fscanf() call directly into __svfscanf_r(), rather than going
> through the intermediate _vfscanf_r(), which contains the
> CHECK_INIT() call.  I was having problems where, if my program calls
> scanf() or fscanf(stdin, ...) before any *printf() calls, stdin got
> permanently locked up.  Here's a patch that fixed things for me:

Thanks, I applied your patch, together with the equivalent change to
fwscanf and wscanf.


Corinna

-- 
Corinna Vinschen
Cygwin Project Co-Leader
Red Hat


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]