From f5be54d6abe3f3a331f40e58f899f66a60165a3c Mon Sep 17 00:00:00 2001 From: David Dykstra Date: Wed, 13 Feb 2002 18:06:36 +0000 Subject: [PATCH] Some systems, notably Sunos4, do not support realloc(NULL, n), so if nothing has yet been malloced in flist_expand(), call malloc instead of realloc. Problem introduced in revision 1.106 of flist.c on January 25. --- flist.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/flist.c b/flist.c index 2e0e7870..cdf0922a 100644 --- a/flist.c +++ b/flist.c @@ -301,7 +301,10 @@ static void flist_expand(struct file_list *flist) new_bytes = sizeof(flist->files[0]) * flist->malloced; - new_ptr = realloc(flist->files, new_bytes); + if (flist->files) + new_ptr = realloc(flist->files, new_bytes); + else + new_ptr = malloc(new_bytes); if (verbose >= 2) { rprintf(FINFO, "expand file_list to %.0f bytes, did%s move\n", -- 2.34.1