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/TMkey.c | |
parent | b1b54c50d0e5851d72c1e7aff4057687be2e447e (diff) |
Replace XtMalloc() calls with XtMallocArray()
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'src/TMkey.c')
-rw-r--r-- | src/TMkey.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/TMkey.c b/src/TMkey.c index 40a5c19..aa3f8d9 100644 --- a/src/TMkey.c +++ b/src/TMkey.c @@ -456,15 +456,12 @@ _XtBuildKeysymTables(Display *dpy, register XtPerDisplay pd) &pd->keysyms_per_keycode); XtFree((char *) pd->modKeysyms); - pd->modKeysyms = - (KeySym *) __XtMalloc((Cardinal) KeysymTableSize * sizeof(KeySym)); + pd->modKeysyms = XtMallocArray(KeysymTableSize, (Cardinal) sizeof(KeySym)); maxCount = KeysymTableSize; tempCount = 0; XtFree((char *) pd->modsToKeysyms); - table = - (ModToKeysymTable *) __XtMalloc((Cardinal) 8 * - sizeof(ModToKeysymTable)); + table = XtMallocArray(8, (Cardinal) sizeof(ModToKeysymTable)); pd->modsToKeysyms = table; table[0].mask = ShiftMask; @@ -739,7 +736,7 @@ XtKeysymToKeycodeList(Display *dpy, KeyCode *old = keycodes; maxcodes += KEYCODE_ARRAY_SIZE; - keycodes = (KeyCode *) __XtMalloc(maxcodes * sizeof(KeyCode)); + keycodes = XtMallocArray(maxcodes, (Cardinal) sizeof(KeyCode)); if (ncodes) { (void) memcpy(keycodes, old, ncodes * sizeof(KeyCode)); XtFree((char *) old); |