From e116b9a834835f4f043777727c9943f1794c9753 Mon Sep 17 00:00:00 2001 From: "David E. O'Brien" Date: Wed, 15 Jan 2003 16:10:29 +0000 Subject: Move the realloc outside the inner loop. This reduces the number of times we do the realloc. --- usr.sbin/sysinstall/dist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/sysinstall/dist.c b/usr.sbin/sysinstall/dist.c index c6fc39fa7bff..0177929361d3 100644 --- a/usr.sbin/sysinstall/dist.c +++ b/usr.sbin/sysinstall/dist.c @@ -766,11 +766,11 @@ distExtract(char *parent, Distribution *me) snprintf(prompt, sizeof prompt, "Extracting %s into %s directory...", dist, root_bias(me[i].my_dir)); dialog_gauge("Progress", prompt, 8, 15, 6, 50, (int)((float)(chunk + 1) / numchunks * 100)); + buf = safe_realloc(buf, chunksize); realsize = 0; while (1) { int seconds; - buf = safe_realloc(buf, chunksize); n = fread(buf + realsize, 1, BUFSIZ, fp); if (check_for_interrupt()) { msgConfirm("Media read error: User interrupt."); -- cgit v1.2.3