X-Git-Url: https://git.saurik.com/apple/libc.git/blobdiff_plain/2650fa9ee9806a25904566dea091b1225d74f063..b061a43bf32824cb214e9e3a29a974341de443d4:/gen/nlist.c diff --git a/gen/nlist.c b/gen/nlist.c index a4f7c53..817c043 100644 --- a/gen/nlist.c +++ b/gen/nlist.c @@ -62,6 +62,7 @@ #include #include #include +#include /* Stuff lifted from and since they are gone */ /* @@ -183,8 +184,8 @@ __fdnlist(fd, list) fh.nfat_arch = OSSwapBigToHostInt32(fh.nfat_arch); /* Read in the fat archs */ - fat_archs = (struct fat_arch *)malloc(fh.nfat_arch * - sizeof(struct fat_arch)); + fat_archs = (struct fat_arch *)reallocarray(NULL, fh.nfat_arch, + sizeof(struct fat_arch)); if (fat_archs == NULL) { return (-1); } @@ -216,7 +217,6 @@ __fdnlist(fd, list) fap = cpusubtype_getbestarch(hbi.cpu_type, hbi.cpu_subtype, fat_archs, fh.nfat_arch); #else -#warning Use the cpusubtype functions!!! fap = NULL; for (i = 0; i < fh.nfat_arch; i++) { if (fat_archs[i].cputype == hbi.cpu_type) {