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/imLcIm.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/imLcIm.c')
-rw-r--r-- | nx-X11/lib/X11/imLcIm.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/nx-X11/lib/X11/imLcIm.c b/nx-X11/lib/X11/imLcIm.c index 95d81f6ee..817fb2147 100644 --- a/nx-X11/lib/X11/imLcIm.c +++ b/nx-X11/lib/X11/imLcIm.c @@ -447,7 +447,7 @@ _XimWriteCachedDefaultTree( + XIM_CACHE_TREE_ALIGNMENT-1) & -XIM_CACHE_TREE_ALIGNMENT; DefTreeBase *b = &im->private.local.base; - if (! b->tree && ! (b->tree = Xmalloc (sizeof(DefTree))) ) + if (! b->tree && ! (b->tree = Xcalloc (1, sizeof(DefTree))) ) return; if (! b->mb && ! (b->mb = Xmalloc (1)) ) return; @@ -457,13 +457,11 @@ _XimWriteCachedDefaultTree( return; /* First entry is always unused */ - memset (b->tree, 0, sizeof(DefTree)); b->mb[0] = 0; b->wc[0] = 0; b->utf8[0] = 0; - m = Xmalloc (msize); - memset (m, 0, msize); + m = Xcalloc (1, msize); m->id = XIM_CACHE_MAGIC; m->version = XIM_CACHE_VERSION; m->top = im->private.local.top; |