Dec. 23, 2005
2:15 a.m.
Bill Medland wrote:
+ static const WCHAR dfv[] = { + 'M','S',' ','S','h','e','l','l',' ','D','l','g',0 };
+ if (!dialog->default_font) + { + DWORD len = strlenW (dfv) + 1; + dialog->default_font = msi_alloc(len*sizeof(WCHAR)); + if (!dialog->default_font) return -1; + memcpy (dialog->default_font, dfv, len*sizeof(WCHAR)); + }
How about this? if (!dialog->default_font) dialog->default_font = msi_strdupW( dfv ); Mike
December 2005
4:32 a.m.
New subject: msiexec null reference
On December 22, 2005 06:15 pm, Mike McCormack wrote:
> Bill Medland wrote:
> > + static const WCHAR dfv[] = {
> > + 'M','S',' ','S','h','e','l','l',' ','D','l','g',0
> > };
> >
> >
> > + if (!dialog->default_font)
> > + {
> > + DWORD len = strlenW (dfv) + 1;
> > + dialog->default_font =
> > msi_alloc(len*sizeof(WCHAR)); + if
> > (!dialog->default_font) return -1;
> > + memcpy (dialog->default_font, dfv,
> > len*sizeof(WCHAR)); + }
>
> How about this?
>
> if (!dialog->default_font)
> dialog->default_font = msi_strdupW( dfv );
>
> Mike
1. Alexandre has already committed it, using strdupW. (I am a
little uncomfortable with the asymmetry but heck!)
2. Basically that was what I wanted to do but I couldn't (can't)
find an msi_strdupW anywhere. I suppose I could have written it
as such but seeing as how there wasn't one yet I presumed that
there was insufficient demand.
--
Bill Medland
mailto:billmedland(a)mercuryspeed.com
http://webhome.idirect.com/~kbmed
7399
Age (days ago)
7399
Last active (days ago)
1 comments
2 participants
participants (2)
-
Bill Medland -
Mike McCormack