don't try to copy lpToken when it is NULL

svn path=/trunk/; revision=30446
This commit is contained in:
Christoph von Wittich 2007-11-14 15:02:41 +00:00
parent f29cdc46e5
commit 16e92aa3e5
2 changed files with 7 additions and 5 deletions

View file

@ -36,7 +36,7 @@ DoOpenFile(PINFO pInfo)
static WCHAR szFilter[] = L"Remote Desktop Files (*rdp)\0*.rdp\0";
ZeroMemory(&ofn, sizeof(ofn));
ofn.lStructSize = sizeof(OPENFILENAME);
ofn.lStructSize = sizeof(OPENFILENAMEW);
ofn.hwndOwner = pInfo->hGeneralPage;
ofn.nMaxFile = MAX_PATH;
ofn.nMaxFileTitle = MAX_PATH;
@ -62,7 +62,7 @@ DoSaveAs(PINFO pInfo)
static WCHAR szFilter[] = L"Remote Desktop Files (*rdp)\0*.rdp\0";
ZeroMemory(&ofn, sizeof(ofn));
ofn.lStructSize = sizeof(OPENFILENAME);
ofn.lStructSize = sizeof(OPENFILENAMEW);
ofn.hwndOwner = pInfo->hGeneralPage;
ofn.nMaxFile = MAX_PATH;
ofn.nMaxFileTitle = MAX_PATH;
@ -1118,7 +1118,7 @@ DlgProc(HWND hDlg,
txtRc.right = bmpRc.right * 0.75;
txtRc.bottom = pInfo->headerbitmap.bmHeight * 0.5;
ZeroMemory(&lf, sizeof(LOGFONT));
ZeroMemory(&lf, sizeof(LOGFONTW));
if (LoadStringW(hInst,
IDS_HEADERTEXT1,

View file

@ -252,13 +252,15 @@ ParseSettings(PRDPSETTINGS pRdpSettings,
{
pRdpSettings->pSettings[i].Type = lpToken[0];
lpToken = wcstok(NULL, szSeps);
pRdpSettings->pSettings[i].Value.i = _wtoi(lpToken);
if (lpToken != NULL)
pRdpSettings->pSettings[i].Value.i = _wtoi(lpToken);
}
else if (lpToken[0] == L's')
{
pRdpSettings->pSettings[i].Type = lpToken[0];
lpToken = wcstok(NULL, szSeps);
wcscpy(pRdpSettings->pSettings[i].Value.s, lpToken);
if (lpToken != NULL)
wcscpy(pRdpSettings->pSettings[i].Value.s, lpToken);
}
bFound = TRUE;
}