diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2022-12-10 13:49:56 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2022-12-11 15:36:06 -0800 |
commit | e02e32f71f6c24fcc69bdaf58f6f9e973a017896 (patch) | |
tree | 942bf0f4eafd2fac63249fb0250c4867403abde5 /listing.c | |
parent | 75af06f5f8ffc41fabd100253aad222cb4ab8662 (diff) |
Replace uTypedRealloc() with direct reallocarray() calls
Falls back to realloc() if platform doesn't offer reallocarray().
Also removes uRealloc() since it had no other uses.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'listing.c')
-rw-r--r-- | listing.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -155,7 +155,7 @@ AddMapOnly(char *map) szMapOnly = 5; else szMapOnly *= 2; - mapOnly = uTypedRealloc(list, szMapOnly, char *); + mapOnly = reallocarray(list, szMapOnly, sizeof(char *)); if (!mapOnly) { WSGO("Couldn't allocate list of maps\n"); @@ -175,7 +175,7 @@ AddListing(char *file, char *map) szListing = 10; else szListing *= 2; - list = uTypedRealloc(list, szListing, Listing); + list = reallocarray(list, szListing, sizeof(Listing)); if (!list) { WSGO("Couldn't allocate list of files and maps\n"); |