imm32: ImmGetDescriptionA return does not include NULL byte.

This commit is contained in:
Aric Stewart 2013-09-26 13:47:32 -05:00 committed by Alexandre Julliard
parent 66988a681a
commit cae71ef219
2 changed files with 8 additions and 2 deletions

View File

@ -1540,7 +1540,10 @@ UINT WINAPI ImmGetDescriptionA(
HeapFree( GetProcessHeap(), 0, buf );
return len;
if (len == 0)
return 0;
return len - 1;
}
/***********************************************************************

View File

@ -665,13 +665,16 @@ static void test_ImmGetDescription(void)
lret = ImmGetDescriptionA(hkl, descA, ret + 1);
ok(lret, "ImmGetDescriptionA failed, expected != 0 received 0.\n");
todo_wine ok(lret == ret, "ImmGetDescriptionA failed to return the correct amount of data. Expected %d, got %d.\n", ret, lret);
ok(lret == ret, "ImmGetDescriptionA failed to return the correct amount of data. Expected %d, got %d.\n", ret, lret);
ret /= 2; /* try to copy partially */
lret = ImmGetDescriptionW(hkl, descW, ret + 1);
ok(lret, "ImmGetDescriptionW failed, expected != 0 received 0.\n");
ok(lret == ret, "ImmGetDescriptionW failed to return the correct amount of data. Expected %d, got %d.\n", ret, lret);
lret = ImmGetDescriptionA(hkl, descA, ret + 1);
ok(!lret, "ImmGetDescriptionA should fail\n");
ret = ImmGetDescriptionW(hkl, descW, 1);
ok(!ret, "ImmGetDescriptionW failed, expected 0 received %d.\n", ret);