From 5ccacf1781fb9fb290979631df17b142241fccd8 Mon Sep 17 00:00:00 2001 From: kichik Date: Fri, 6 Jul 2007 10:11:43 +0000 Subject: [PATCH] don't call IPeristFile::Save if MultiByteToWideChar fails git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@5192 212acab6-be3b-0410-9dea-997c60f758d6 --- Source/exehead/exec.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Source/exehead/exec.c b/Source/exehead/exec.c index 6913616f..4d8cdcc3 100644 --- a/Source/exehead/exec.c +++ b/Source/exehead/exec.c @@ -1050,9 +1050,8 @@ static int NSISCALL ExecuteEntry(entry *entry_) if (SUCCEEDED(hres)) { static WCHAR wsz[1024]; - wsz[0]=0; - MultiByteToWideChar(CP_ACP, 0, buf1, -1, wsz, 1024); - hres=ppf->lpVtbl->Save(ppf,(const WCHAR*)wsz,TRUE); + if (MultiByteToWideChar(CP_ACP, 0, buf1, -1, wsz, 1024)) + hres=ppf->lpVtbl->Save(ppf,(const WCHAR*)wsz,TRUE); } ppf->lpVtbl->Release(ppf); }