[PATCH:libX11 3/8] ifdef out code that truncates the source length to the destination length if it is larger. Seems useless to do that since the code tests for both source length and destination to be non-zero. This fixes cut-n-paste problem in xterm where the paste length was limited to 1024 (BUFSIZ) in button.c

Thomas Klausner wiz at NetBSD.org
Sun Jun 2 11:49:50 PDT 2013


---
 modules/lc/gen/lcGenConv.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/modules/lc/gen/lcGenConv.c b/modules/lc/gen/lcGenConv.c
index 42d63c5..5a4fd64 100644
--- a/modules/lc/gen/lcGenConv.c
+++ b/modules/lc/gen/lcGenConv.c
@@ -764,8 +764,10 @@ mbstowcs_org(
         return( 0 );
     }
 
+#ifdef notdef
     if (*from_left > *to_left)
         *from_left = *to_left;
+#endif
 
     while (*from_left && *to_left) {
 
@@ -921,8 +923,10 @@ wcstombs_org(
     int defstr_len = strlen(default_string);
 
 
+#ifdef notdef
     if (*from_left > *to_left)
         *from_left = *to_left;
+#endif
 
     while (*from_left && *to_left) {
 
@@ -1080,8 +1084,10 @@ wcstocts(
     int from_size = *from_left;
     char *ext_seg_len = NULL;
 
+#ifdef notdef
     if (*from_left > *to_left)
         *from_left = *to_left;
+#endif
 
     while (*from_left && *to_left) {
 
@@ -1272,8 +1278,10 @@ ctstowcs(
         return( 0 );
     }
 
+#ifdef notdef
     if (*from_left > *to_left)
         *from_left = *to_left;
+#endif
 
     while (*from_left && *to_left) {
 
@@ -1666,8 +1674,10 @@ mbstostr(
         return( 0 );
     }
 
+#ifdef notdef
     if (*from_left > *to_left)
         *from_left = *to_left;
+#endif
 
     while (*from_left && *to_left) {
 
@@ -1957,8 +1967,10 @@ wcstostr(
     int defstr_len = strlen(default_string);
 
 
+#ifdef notdef
     if (*from_left > *to_left)
         *from_left = *to_left;
+#endif
 
     while (*from_left && *to_left) {
 
@@ -2114,8 +2126,10 @@ wctocs(
     char *outbufptr = *to;
     int from_size = *from_left;
 
+#ifdef notdef
     if (*from_left > *to_left)
         *from_left = *to_left;
+#endif
 
     if (*from_left && *to_left) {
 
@@ -2427,8 +2441,10 @@ strtombs(
     char *outbufptr = *to;
     int from_size = *from_left;
 
+#ifdef notdef
     if (*from_left > *to_left)
         *from_left = *to_left;
+#endif
 
     while (*from_left && *to_left) {
 
@@ -2537,8 +2553,10 @@ strtowcs(
     wchar_t *outbufptr = (wchar_t *)*to;
     int from_size = *from_left;
 
+#ifdef notdef
     if (*from_left > *to_left)
         *from_left = *to_left;
+#endif
 
     while (*from_left && *to_left) {
 
-- 
1.8.2.3



More information about the xorg-devel mailing list