summaryrefslogtreecommitdiff
path: root/keytypes.c
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2022-12-10 14:07:18 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2022-12-11 15:36:06 -0800
commit8d85bd1e2f9473958b235caf7af9913b518f73dd (patch)
tree3348aa708638b6dbe31e9b1ca17d49465df85e8d /keytypes.c
parente02e32f71f6c24fcc69bdaf58f6f9e973a017896 (diff)
Replace uTypedRecalloc() with direct recallocarray() calls
Retains uRecalloc() as a fallback for platforms without recallocarray() Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'keytypes.c')
-rw-r--r--keytypes.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/keytypes.c b/keytypes.c
index a8aaadd..707ee6f 100644
--- a/keytypes.c
+++ b/keytypes.c
@@ -525,9 +525,9 @@ NextMapEntry(KeyTypeInfo * type)
else if (type->nEntries >= type->szEntries)
{
type->szEntries *= 2;
- type->entries = uTypedRecalloc(type->entries,
- type->nEntries, type->szEntries,
- XkbKTMapEntryRec);
+ type->entries = recallocarray(type->entries,
+ type->nEntries, type->szEntries,
+ sizeof(XkbKTMapEntryRec));
if (type->entries == NULL)
{
ERROR("Couldn't reallocate map entries for %s\n", TypeTxt(type));
@@ -787,8 +787,8 @@ AddLevelName(KeyTypeInfo * type,
{
if ((type->lvlNames == NULL) || (type->szNames <= level))
{
- type->lvlNames =
- uTypedRecalloc(type->lvlNames, type->szNames, level + 1, Atom);
+ type->lvlNames = recallocarray(type->lvlNames, type->szNames,
+ level + 1, sizeof(Atom));
if (type->lvlNames == NULL)
{
ERROR("Couldn't allocate level names for type %s\n",