From 68bbf6fb18464f2b1f09954dda8dc121393a3046 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Wed, 10 May 2017 15:28:27 -0500 Subject: [PATCH] winex11: Remove all trailing nulls when exporting text strings. Signed-off-by: Alexandre Julliard --- dlls/winex11.drv/clipboard.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/winex11.drv/clipboard.c b/dlls/winex11.drv/clipboard.c index 2566d019ac5..3c1f3b4a33e 100644 --- a/dlls/winex11.drv/clipboard.c +++ b/dlls/winex11.drv/clipboard.c @@ -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 )); }