Alexandre Julliard : winex11: Remove all trailing nulls when exporting text strings.

Alexandre Julliard julliard at winehq.org
Wed May 10 17:23:18 CDT 2017


Module: wine
Branch: master
Commit: 68bbf6fb18464f2b1f09954dda8dc121393a3046
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=68bbf6fb18464f2b1f09954dda8dc121393a3046

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Wed May 10 15:28:27 2017 -0500

winex11: Remove all trailing nulls when exporting text strings.

Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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 2566d01..3c1f3b4 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 ));
     }




More information about the wine-cvs mailing list