This is the mail archive of the cygwin mailing list for the Cygwin 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: cat /proc/registry/HKEY_PERFOMANCE_DATA/@ hangs


On Jul 14 17:58, Dave Korn wrote:
> > -----Original Message-----
> > From: cygwin-owner On Behalf Of Igor Pechtchanski
> > Sent: 14 July 2004 04:22
> 
> > Ok, the theory washed out.  The code above is actually simply 
> > buggy.  When
> > RegQueryValueEx is called (2 lines below the arrow), the 
> > "size" parameter
> > is uninitialized, so, in effect, it keeps thinking that the buffer has
> > some random size and reallocating (which, of course, doesn't 
> > change the
> > size, hence the infinite loop).
> 
>   I concur; that is bad code.  The variable unambiguously needs
> initialising, and since RegQueryValueEx damages it, it needs to be re-set
> each time round the loop.  
> [...]

I'm wondering if that isn't mildly OT here.  Shouldn't that be discussed
on cygwin-developers in a perfect world?

Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Co-Project Leader          mailto:cygwin@cygwin.com
Red Hat, Inc.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


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