dwrite: Protect from space-only strings when trimming away spaces.

This commit is contained in:
Nikolay Sivov 2015-08-18 23:49:50 +03:00 committed by Alexandre Julliard
parent 6b98b9ac70
commit 1f54400bbf
1 changed files with 4 additions and 1 deletions

View File

@ -1967,7 +1967,10 @@ static int trim_spaces(WCHAR *in, WCHAR *ret)
while (isspaceW(*in))
in++;
len = strlenW(in);
ret[0] = 0;
if (!(len = strlenW(in)))
return 0;
while (isspaceW(in[len-1]))
len--;