aboutsummaryrefslogtreecommitdiff
path: root/libX11/modules/lc/gen
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2014-06-08 15:05:49 +0200
committermarha <marha@users.sourceforge.net>2014-06-08 15:05:49 +0200
commit71cc8d9b7dc729934a29445cbd6d1f7a6d9ecbec (patch)
treeea689cdd51f395980ddc37dc33781635976f3a16 /libX11/modules/lc/gen
parentaec798fb4dc72d616732d0fa711faffaa8cd7590 (diff)
parent2acb86c9b086bdb9a3897db0b93820652e07cb59 (diff)
downloadvcxsrv-71cc8d9b7dc729934a29445cbd6d1f7a6d9ecbec.tar.gz
vcxsrv-71cc8d9b7dc729934a29445cbd6d1f7a6d9ecbec.tar.bz2
vcxsrv-71cc8d9b7dc729934a29445cbd6d1f7a6d9ecbec.zip
Merge remote-tracking branch 'origin/released'
Conflicts: apps/xwininfo/xwininfo.c xorg-server/hw/xwin/glx/indirect.c
Diffstat (limited to 'libX11/modules/lc/gen')
-rw-r--r--libX11/modules/lc/gen/lcGenConv.c53
1 files changed, 24 insertions, 29 deletions
diff --git a/libX11/modules/lc/gen/lcGenConv.c b/libX11/modules/lc/gen/lcGenConv.c
index 1f7c301f5..eede76807 100644
--- a/libX11/modules/lc/gen/lcGenConv.c
+++ b/libX11/modules/lc/gen/lcGenConv.c
@@ -753,7 +753,7 @@ mbstowcs_org(
CodeSet codeset = NULL;
- const char *inbufptr = *from;
+ const char *inbufptr;
wchar_t *outbufptr = (wchar_t *) *to;
int from_size = *from_left;
@@ -764,6 +764,8 @@ mbstowcs_org(
return( 0 );
}
+ inbufptr = *from;
+
while (*from_left && *to_left) {
ch = *inbufptr++;
@@ -1223,8 +1225,7 @@ stdc_wcstocts(
goto ret;
ret:
- if (buf)
- Xfree(buf);
+ Xfree(buf);
return (unconv_num1 + unconv_num2);
}
@@ -1252,7 +1253,7 @@ ctstowcs(
CodeSet codeset = NULL;
XlcCharSet charset_tmp;
- const char *inbufptr = *from;
+ const char *inbufptr;
wchar_t *outbufptr = (wchar_t *) *to;
int from_size = *from_left;
@@ -1262,6 +1263,7 @@ ctstowcs(
_XlcResetConverter(conv);
return( 0 );
}
+ inbufptr = *from;
while (*from_left && *to_left) {
@@ -1437,7 +1439,7 @@ cstowcs(
CodeSet codeset = NULL;
XlcCharSet charset, charset_tmp;
- const char *inbufptr = *from;
+ const char *inbufptr;
wchar_t *outbufptr = (wchar_t *) *to;
int from_size = *from_left;
@@ -1445,6 +1447,8 @@ cstowcs(
return( 0 );
}
+ inbufptr = *from;
+
charset = (XlcCharSet) args[0];
while (*from_left && *to_left) {
@@ -1543,8 +1547,7 @@ stdc_ctstowcs(
goto ret;
ret:
- if (buf)
- Xfree(buf);
+ Xfree(buf);
return (unconv_num1 + unconv_num2);
}
@@ -1579,8 +1582,7 @@ stdc_cstowcs(
goto ret;
ret:
- if (buf)
- Xfree(buf);
+ Xfree(buf);
return (unconv_num1 + unconv_num2);
}
@@ -1615,8 +1617,7 @@ mbstocts(
goto ret;
ret:
- if (buf)
- Xfree(buf);
+ Xfree(buf);
return (unconv_num1 + unconv_num2);
}
@@ -1643,7 +1644,7 @@ mbstostr(
CodeSet codeset = NULL;
- const char *inbufptr = *from;
+ const char *inbufptr;
char *outbufptr = *to;
int from_size = *from_left;
@@ -1654,6 +1655,8 @@ mbstostr(
return( 0 );
}
+ inbufptr = *from;
+
while (*from_left && *to_left) {
ch = *inbufptr++;
@@ -1758,7 +1761,7 @@ mbtocs(
CodeSet codeset = NULL;
XlcCharSet charset = NULL;
- const char *inbufptr = *from;
+ const char *inbufptr;
char *outbufptr = *to;
int from_size = *from_left;
@@ -1769,6 +1772,8 @@ mbtocs(
return( 0 );
}
+ inbufptr = *from;
+
while (*from_left && *to_left) {
ch = *inbufptr++;
@@ -2062,8 +2067,7 @@ stdc_wcstostr(
goto ret;
ret:
- if (buf)
- Xfree(buf);
+ Xfree(buf);
return (unconv_num1 + unconv_num2);
}
@@ -2337,8 +2341,7 @@ ctstombs(
goto ret;
ret:
- if (buf)
- Xfree(buf);
+ Xfree(buf);
return (unconv_num1 + unconv_num2);
}
@@ -2373,8 +2376,7 @@ cstombs(
goto ret;
ret:
- if (buf)
- Xfree(buf);
+ Xfree(buf);
return (unconv_num1 + unconv_num2);
}
@@ -2582,8 +2584,7 @@ stdc_strtowcs(
goto ret;
ret:
- if (buf)
- Xfree(buf);
+ Xfree(buf);
return (unconv_num1 + unconv_num2);
}
@@ -2596,14 +2597,8 @@ static void
close_converter(
XlcConv conv)
{
- if (conv->state) {
- Xfree(conv->state);
- }
-
- if (conv->methods) {
- Xfree(conv->methods);
- }
-
+ Xfree(conv->state);
+ Xfree(conv->methods);
Xfree(conv);
}