localspl: Do not crash when Xcv was opened without a space in the name.

This commit is contained in:
Detlef Riekenberg 2007-03-06 05:40:50 +01:00 committed by Alexandre Julliard
parent 753e61fe11
commit 2253edb7a3
1 changed files with 7 additions and 1 deletions

View File

@ -520,7 +520,13 @@ DWORD WINAPI localmon_XcvDataPort(HANDLE hXcv, LPCWSTR pszDataName, PBYTE pInput
if (!lstrcmpW(pszDataName, cmd_SetDefaultCommConfigW)) {
/* get the portname from the Handle */
ptr = strchrW(((xcv_t *)hXcv)->nameW, ' ');
ptr++; /* skip the space */
if (ptr) {
ptr++; /* skip the space */
}
else
{
ptr = ((xcv_t *)hXcv)->nameW;
}
lstrcpynW(buffer, ptr, sizeof(buffer)/sizeof(WCHAR));
if (buffer[0]) buffer[lstrlenW(buffer)-1] = '\0'; /* remove the ':' */
res = SetDefaultCommConfigW(buffer, (LPCOMMCONFIG) pInputData, cbInputData);