summaryrefslogtreecommitdiff
path: root/src/TMaction.c
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2023-03-03 17:42:47 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2023-03-07 00:06:24 +0000
commitb3b0c1ad25a5d0f628eddd00113a40364d68480b (patch)
tree7b1088ab3cc984dd606df1b56fdda7dec975432f /src/TMaction.c
parentb1b54c50d0e5851d72c1e7aff4057687be2e447e (diff)
Replace XtMalloc() calls with XtMallocArray()
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'src/TMaction.c')
-rw-r--r--src/TMaction.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/TMaction.c b/src/TMaction.c
index 3fbc879..c577b71 100644
--- a/src/TMaction.c
+++ b/src/TMaction.c
@@ -110,8 +110,8 @@ CompileActionTable(register RConst struct _XtActionsRec *actions, register Cardi
func = (perm ? XrmPermStringToQuark : XrmStringToQuark);
if (!stat) {
- cTableHold = cActions = (CompiledActionTable)
- __XtMalloc((Cardinal) ((size_t) count * sizeof(CompiledAction)));
+ cTableHold = cActions = XtMallocArray(count,
+ (Cardinal) sizeof(CompiledAction));
for (i = (int) count; --i >= 0; cActions++, actions++) {
cActions->proc = actions->proc;
@@ -761,9 +761,8 @@ XtGetActionList(WidgetClass widget_class,
}
*num_actions_return = widget_class->core_class.num_actions;
if (*num_actions_return) {
- XtActionList list = *actions_return = (XtActionList)
- __XtMalloc((Cardinal)
- ((size_t) *num_actions_return * sizeof(XtActionsRec)));
+ XtActionList list = *actions_return =
+ XtMallocArray(*num_actions_return, (Cardinal) sizeof(XtActionsRec));
table = GetClassActions(widget_class);