summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2019-08-03 19:09:19 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2019-08-03 19:31:14 -0700
commitf54470dab5b392380df61a22b4b4bef685b6cee2 (patch)
tree561d2a367f295f3fe53f72712b3b3f3d1011ec18 /test
parent27207d35d4b4bbd5d2b2c5f7e13a61ea43d04a4a (diff)
Convert multiplying realloc calls to use reallocarray instead
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'test')
-rw-r--r--test/utils/font-test-utils.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/utils/font-test-utils.c b/test/utils/font-test-utils.c
index bc4039e..ff05061 100644
--- a/test/utils/font-test-utils.c
+++ b/test/utils/font-test-utils.c
@@ -53,6 +53,7 @@ SOFTWARE.
*/
#include "font-test-utils.h"
+#include "src/util/replace.h"
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
@@ -133,7 +134,8 @@ test_register_fpe_funcs(const xfont2_fpe_funcs_rec *funcs)
xfont2_fpe_funcs_rec const **new;
/* grow the list */
- new = realloc(fpe_functions, (num_fpe_types + 1) * sizeof(xfont2_fpe_funcs_ptr));
+ new = reallocarray(fpe_functions, (num_fpe_types + 1),
+ sizeof(xfont2_fpe_funcs_ptr));
assert (new != NULL);
fpe_functions = new;