This is the mail archive of the
mailing list for the Cygwin project.
RE: Patch for Setup.exe problem and for mklink2.cc
- From: "Robert Collins" <robert dot collins at itdomain dot com dot au>
- To: "Ton van Overbeek" <tvoverbe at cistron dot nl>,<cygwin-apps at cygwin dot com>,<cygwin-patches at cygwin dot com>
- Cc: <jonas_eriksson at home dot se>
- Date: Fri, 29 Mar 2002 20:25:08 +1100
- Subject: RE: Patch for Setup.exe problem and for mklink2.cc
> -----Original Message-----
> From: Robert Collins
> Sent: Thursday, March 28, 2002 1:11 AM
> To: Ton van Overbeek; email@example.com;
> Cc: firstname.lastname@example.org
> Subject: RE: Patch for Setup.exe problem and for mklink2.cc
> > -----Original Message-----
> > From: Ton van Overbeek [mailto:email@example.com]
> > Sent: Thursday, March 28, 2002 1:03 AM
> > To: firstname.lastname@example.org; email@example.com
> > Cc: firstname.lastname@example.org
> > Subject: Patch for Setup.exe problem and for mklink2.cc
> > Found the problem causing the segment violation and probably
> > causing Jonas Eriksson's problem. It is a typical case of
> > 'off by 1'. In PickView::set_headers the loop filling the
> > window header does one iteration too much, resulting in a
> > call to DoInsertItem with a NULL string pointer and hence a
> > crash following. While debugging this I could not compile the
> > new mklink2.cc ( the
> > c++ version of the original mklink2.c). It seems three & (address of
> > c++ operator)
> > have disappeared in the transition. Putting them back made
> > the compiler happy. Is this OK Robert ?
> I'll check the off-by-one fix in tomorrow, as I'm off to bed now.
Actually, this is not an off-by-one error. It's an invalid data error -
the loop is meant to go from 0 to == last_col, where last col is meant
to be equal to the greatest column number. The first set of column
details had last_col set incorrectly.
Thanks for pinpointing this though.