diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2015-03-21 17:59:13 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2015-04-21 16:58:08 -0700 |
commit | 0018784cdde19444a8f970bc414796fc2a523a51 (patch) | |
tree | 779eb85d61f1ef33485fea8783b0d7f7080d2276 /hw/dmx/dmxfont.c | |
parent | dc5acaa28ab9ed091f087e56046400d63f1f192a (diff) |
Convert hw/dmx to new *allocarray functions
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Diffstat (limited to 'hw/dmx/dmxfont.c')
-rw-r--r-- | hw/dmx/dmxfont.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/hw/dmx/dmxfont.c b/hw/dmx/dmxfont.c index 115422d41..25a04a6f0 100644 --- a/hw/dmx/dmxfont.c +++ b/hw/dmx/dmxfont.c @@ -72,7 +72,7 @@ dmxGetFontPath(int *npaths) newfp = malloc(*npaths + len); c = (unsigned char *) newfp; - fp = malloc(*npaths * sizeof(*fp)); + fp = xallocarray(*npaths, sizeof(*fp)); memmove(newfp, paths + 1, *npaths + len - 1); l = *paths; @@ -306,7 +306,7 @@ dmxBELoadFont(ScreenPtr pScreen, FontPtr pFont) if (!dmxFontPath) dmxLog(dmxWarning, "No default font path is set.\n"); - goodfps = malloc(npaths * sizeof(*goodfps)); + goodfps = xallocarray(npaths, sizeof(*goodfps)); dmxLog(dmxError, "The DMX server failed to set the following font paths on " @@ -354,7 +354,7 @@ dmxBELoadFont(ScreenPtr pScreen, FontPtr pFont) return FALSE; } - newfp = malloc(len * sizeof(*newfp)); + newfp = xallocarray(len, sizeof(*newfp)); for (i = 0; i < npaths; i++) { if (goodfps[i]) { int n = strlen(fp[i]); |