diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2023-03-03 17:42:47 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2023-03-07 00:06:24 +0000 |
commit | b3b0c1ad25a5d0f628eddd00113a40364d68480b (patch) | |
tree | 7b1088ab3cc984dd606df1b56fdda7dec975432f /src/Initialize.c | |
parent | b1b54c50d0e5851d72c1e7aff4057687be2e447e (diff) |
Replace XtMalloc() calls with XtMallocArray()
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'src/Initialize.c')
-rw-r--r-- | src/Initialize.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/Initialize.c b/src/Initialize.c index ff5eee8..03bb59c 100644 --- a/src/Initialize.c +++ b/src/Initialize.c @@ -668,9 +668,8 @@ _MergeOptionTables(const XrmOptionDescRec *src1, int dst_len, order; enum { Check, NotSorted, IsSorted } sort_order = Check; - *dst = table = (XrmOptionDescRec *) - __XtMalloc((Cardinal) - (sizeof(XrmOptionDescRec) * (num_src1 + num_src2))); + *dst = table = XtMallocArray(num_src1 + num_src2, + (Cardinal) sizeof(XrmOptionDescRec)); (void) memcpy(table, src1, sizeof(XrmOptionDescRec) * num_src1); if (num_src2 == 0) { @@ -786,8 +785,7 @@ _XtPreparseCommandLine(XrmOptionDescRec *urlist, _XtString *targv; int targc = argc; - targv = (_XtString *) - __XtMalloc((Cardinal) (sizeof(_XtString *) * (size_t) argc)); + targv = XtMallocArray((Cardinal) argc, (Cardinal) sizeof(_XtString *)); (void) memcpy(targv, argv, sizeof(char *) * (size_t) argc); _MergeOptionTables(opTable, XtNumber(opTable), urlist, num_urs, &options, &num_options); |