diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2015-06-04 20:51:17 -0700 |
---|---|---|
committer | Ulrich Sibiller <uli42@gmx.de> | 2016-10-19 21:40:29 +0200 |
commit | 39dd37d57b7bab3e44304562d1bbf9722bf3e03e (patch) | |
tree | 138adc51b876dda86ce0a4498efa187eaa1bbb63 /nx-X11/lib/X11/XDefaultIMIF.c | |
parent | a402ed0162562b43a945d9a90b406c54c87c72b6 (diff) | |
download | nx-libs-39dd37d57b7bab3e44304562d1bbf9722bf3e03e.tar.gz nx-libs-39dd37d57b7bab3e44304562d1bbf9722bf3e03e.tar.bz2 nx-libs-39dd37d57b7bab3e44304562d1bbf9722bf3e03e.zip |
Replace Xmalloc+memset pairs with Xcalloc calls
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Backported-to-NX-by: Ulrich Sibiller <uli42@gmx.de>
Diffstat (limited to 'nx-X11/lib/X11/XDefaultIMIF.c')
-rw-r--r-- | nx-X11/lib/X11/XDefaultIMIF.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/nx-X11/lib/X11/XDefaultIMIF.c b/nx-X11/lib/X11/XDefaultIMIF.c index db0f5d1fa..2eb52ae4a 100644 --- a/nx-X11/lib/X11/XDefaultIMIF.c +++ b/nx-X11/lib/X11/XDefaultIMIF.c @@ -184,16 +184,14 @@ _XDefaultOpenIM( return((XIM)NULL); } - if ((im = Xmalloc(sizeof(StaticXIMRec))) == (StaticXIM)NULL) { + if ((im = Xcalloc(1, sizeof(StaticXIMRec))) == (StaticXIM)NULL) { return((XIM)NULL); } - if ((local_impart = Xmalloc(sizeof(XIMStaticXIMRec))) + if ((local_impart = Xcalloc(1, sizeof(XIMStaticXIMRec))) == (XIMStaticXIMRec *)NULL) { Xfree(im); return((XIM)NULL); } - memset(im, 0, sizeof(StaticXIMRec)); - memset(local_impart, 0, sizeof(XIMStaticXIMRec)); buf[0] = '\0'; i = 0; @@ -344,10 +342,9 @@ _CreateIC(XIM im, XIMArg *arg) { XIC ic; - if ((ic = Xmalloc(sizeof(XICRec))) == (XIC)NULL) { + if ((ic = Xcalloc(1, sizeof(XICRec))) == (XIC)NULL) { return ((XIC)NULL); } - memset(ic, 0, sizeof(XICRec)); ic->methods = (XICMethods)&local_ic_methods; ic->core.im = im; |