Mail Archives: cygwin-apps/2002/03/27/09:07:55
This is a multi-part message in MIME format.
--------------4E10E38C83FCB4712E588E7C
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
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 operator)
have disappeared in the transition. Putting them back made the compiler
happy. Is this OK Robert ?
Changelog
2002-03-27 Ton van Overbeek (tvoverbe AT cistron DOT nl)
* Pickview.cc (PickView::set_headers) Correct loop count for DoInsertItem.
* mklink2.cc (make_link_2) Reinsert three & operators which got lost in the
c -> c++ transition.
Patch in attached file.
Ton van Overbeek
--------------4E10E38C83FCB4712E588E7C
Content-Type: text/plain; charset=us-ascii;
name="patch.txt"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="patch.txt"
--- mklink2.cc-orig Wed Mar 27 12:18:34 2002
+++ mklink2.cc Wed Mar 27 12:41:16 2002
@@ -20,9 +20,9 @@ make_link_2 (char const *exepath, char c
IPersistFile *pf;
WCHAR widepath[_MAX_PATH];
- CoCreateInstance (CLSID_ShellLink, NULL,
- CLSCTX_INPROC_SERVER, IID_IShellLink, (LPVOID *) & sl);
- sl->lpVtbl->QueryInterface (sl, IID_IPersistFile, (void **) &pf);
+ CoCreateInstance (&CLSID_ShellLink, NULL,
+ CLSCTX_INPROC_SERVER, &IID_IShellLink, (LPVOID *) & sl);
+ sl->lpVtbl->QueryInterface (sl, &IID_IPersistFile, (void **) &pf);
sl->lpVtbl->SetPath (sl, exepath);
sl->lpVtbl->SetArguments (sl, args);
--- PickView.cc-orig Wed Mar 27 12:18:26 2002
+++ PickView.cc Wed Mar 27 12:20:16 2002
@@ -110,7 +110,7 @@ PickView::set_headers ()
SendMessage (listheader, HDM_DELETEITEM, n - 1, 0);
}
int i;
- for (i = 0; i <= last_col; i++)
+ for (i = 0; i < last_col; i++)
DoInsertItem (listheader, i, headers[i].width, (char *) headers[i].text);
}
--------------4E10E38C83FCB4712E588E7C--
- Raw text -