This is the mail archive of the 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]

Patch for Setup.exe problem and for

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 ( 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 ?

2002-03-27  Ton van Overbeek (
* (PickView::set_headers) Correct loop count for DoInsertItem.

* (make_link_2) Reinsert three & operators which got lost in the
  c -> c++ transition.

Patch in attached file.

Ton van Overbeek
---	Wed Mar 27 12:18:34 2002
+++	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);
---	Wed Mar 27 12:18:26 2002
+++	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);

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