diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2011-04-12 21:27:45 -0700 |
---|---|---|
committer | Ulrich Sibiller <uli42@gmx.de> | 2016-10-19 21:40:25 +0200 |
commit | 7d7224d8543e85e3a34a1cddf99f3eac9aa9050b (patch) | |
tree | 15e7affd8446b031fe6bc98bcb5b0419dc04ab7b /nx-X11/lib/X11/Xrm.c | |
parent | 369c956683108226a30bbdd55355f0d8ae57eeb4 (diff) | |
download | nx-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/Xrm.c')
-rw-r--r-- | nx-X11/lib/X11/Xrm.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/nx-X11/lib/X11/Xrm.c b/nx-X11/lib/X11/Xrm.c index 81fbfaf35..d3668affa 100644 --- a/nx-X11/lib/X11/Xrm.c +++ b/nx-X11/lib/X11/Xrm.c @@ -581,23 +581,21 @@ static void GrowTable( ltable = (LTable)table; /* cons up a copy to make MoveValues look symmetric */ otable = *ltable; - ltable->buckets = (VEntry *)Xmalloc(i * sizeof(VEntry)); + ltable->buckets = Xcalloc(i, sizeof(VEntry)); if (!ltable->buckets) { ltable->buckets = otable.buckets; return; } ltable->table.mask = i - 1; - bzero((char *)ltable->buckets, i * sizeof(VEntry)); MoveValues(&otable, ltable); } else { register NTable ntable; - ntable = (NTable)Xmalloc(sizeof(NTableRec) + i * sizeof(NTable)); + ntable = Xcalloc(1, sizeof(NTableRec) + (i * sizeof(NTable))); if (!ntable) return; *ntable = *table; ntable->mask = i - 1; - bzero((char *)NodeBuckets(ntable), i * sizeof(NTable)); *prev = ntable; MoveTables(table, ntable); } |