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 )); }