winex11: Remove all trailing nulls when exporting text strings.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2017-05-10 15:28:27 -05:00
parent 0bdebc66c6
commit 68bbf6fb18
1 changed files with 1 additions and 1 deletions

View File

@ -1130,7 +1130,7 @@ static char *string_from_unicode_text( UINT codepage, HANDLE handle, UINT *size
if (str[i] == '\r' && (i == len - 1 || str[i + 1] == '\n')) continue;
str[j++] = str[i];
}
if (j && !str[j - 1]) j--; /* remove trailing null */
while (j && !str[j - 1]) j--; /* remove trailing nulls */
*size = j;
TRACE( "returning %s\n", debugstr_an( str, j ));
}