aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/lib/X11/imRm.c
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2011-04-12 21:27:45 -0700
committerUlrich Sibiller <uli42@gmx.de>2016-10-19 21:40:25 +0200
commit7d7224d8543e85e3a34a1cddf99f3eac9aa9050b (patch)
tree15e7affd8446b031fe6bc98bcb5b0419dc04ab7b /nx-X11/lib/X11/imRm.c
parent369c956683108226a30bbdd55355f0d8ae57eeb4 (diff)
downloadnx-libs-7d7224d8543e85e3a34a1cddf99f3eac9aa9050b.tar.gz
nx-libs-7d7224d8543e85e3a34a1cddf99f3eac9aa9050b.tar.bz2
nx-libs-7d7224d8543e85e3a34a1cddf99f3eac9aa9050b.zip
Replace Xmalloc+bzero pairs with Xcalloc calls
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Backported-to-NX-by: Ulrich Sibiller <uli42@gmx.de>
Diffstat (limited to 'nx-X11/lib/X11/imRm.c')
-rw-r--r--nx-X11/lib/X11/imRm.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/nx-X11/lib/X11/imRm.c b/nx-X11/lib/X11/imRm.c
index 7f79765e1..448cf41e6 100644
--- a/nx-X11/lib/X11/imRm.c
+++ b/nx-X11/lib/X11/imRm.c
@@ -360,10 +360,9 @@ _XimDefaultStyles(
n = XIMNumber(supported_local_styles) - 1;
len = sizeof(XIMStyles) + sizeof(XIMStyle) * n;
- if(!(tmp = (XPointer)Xmalloc(len))) {
+ if(!(tmp = Xcalloc(1, len))) {
return False;
}
- bzero(tmp, len);
styles = (XIMStyles *)tmp;
if (n > 0) {
@@ -396,10 +395,9 @@ _XimDefaultIMValues(
n = XIMNumber(supported_local_im_values_list);
len = sizeof(XIMValuesList) + sizeof(char **) * n;
- if(!(tmp = (XPointer)Xmalloc(len))) {
+ if(!(tmp = Xcalloc(1, len))) {
return False;
}
- bzero(tmp, len);
values_list = (XIMValuesList *)tmp;
if (n > 0) {
@@ -433,10 +431,9 @@ _XimDefaultICValues(
n = XIMNumber(supported_local_ic_values_list);
len = sizeof(XIMValuesList) + sizeof(char **) * n;
- if(!(tmp = (XPointer)Xmalloc(len))) {
+ if(!(tmp = Xcalloc(1, len))) {
return False;
}
- bzero(tmp, len);
values_list = (XIMValuesList *)tmp;
if (n > 0) {
@@ -1085,10 +1082,9 @@ _XimDecodeStyles(
num = styles->count_styles;
len = sizeof(XIMStyles) + sizeof(XIMStyle) * num;
- if(!(tmp = (XPointer)Xmalloc(len))) {
+ if(!(tmp = Xcalloc(1, len))) {
return False;
}
- bzero(tmp, len);
out = (XIMStyles *)tmp;
if(num >0) {
@@ -1124,10 +1120,9 @@ _XimDecodeValues(
num = values_list->count_values;
len = sizeof(XIMValuesList) + sizeof(char **) * num;
- if(!(tmp = (char *)Xmalloc(len))) {
+ if(!(tmp = Xcalloc(1, len))) {
return False;
}
- bzero(tmp, len);
out = (XIMValuesList *)tmp;
if(num) {
@@ -2143,10 +2138,9 @@ _XimSetResourceList(
XIMResourceList res;
len = sizeof(XIMResource) * num_resource;
- if(!(res = (XIMResourceList)Xmalloc(len))) {
+ if(!(res = Xcalloc(1, len))) {
return False;
}
- bzero((char *)res, len);
for(i = 0; i < num_resource; i++, id++) {
res[i] = resource[i];