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/Display.c | |
parent | b1b54c50d0e5851d72c1e7aff4057687be2e447e (diff) |
Replace XtMalloc() calls with XtMallocArray()
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'src/Display.c')
-rw-r--r-- | src/Display.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/Display.c b/src/Display.c index 879b71a..c4928a0 100644 --- a/src/Display.c +++ b/src/Display.c @@ -346,9 +346,8 @@ _XtAppInit(XtAppContext *app_context_return, /* * Save away argv and argc so we can set the properties later */ - saved_argv = (_XtString *) - __XtMalloc((Cardinal) - ((size_t) (*argc_in_out + 1) * sizeof(_XtString))); + saved_argv = XtMallocArray((Cardinal) *argc_in_out + 1, + (Cardinal) sizeof(_XtString)); for (i = 0; i < *argc_in_out; i++) saved_argv[i] = (*argv_in_out)[i]; @@ -817,9 +816,8 @@ XtGetDisplays(XtAppContext app_context, LOCK_APP(app_context); *num_dpy_return = (Cardinal) app_context->count; - *dpy_return = (Display **) - __XtMalloc((Cardinal) - ((size_t) app_context->count * sizeof(Display *))); + *dpy_return = XtMallocArray((Cardinal) app_context->count, + (Cardinal) sizeof(Display *)); for (ii = 0; ii < app_context->count; ii++) (*dpy_return)[ii] = app_context->list[ii]; UNLOCK_APP(app_context); |