aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid E. O'Brien <obrien@FreeBSD.org>2003-01-15 16:10:29 +0000
committerDavid E. O'Brien <obrien@FreeBSD.org>2003-01-15 16:10:29 +0000
commite116b9a834835f4f043777727c9943f1794c9753 (patch)
tree0fad0df5da9fb052341e485282969dc3b14becfd
parent0a39a49986f554f0d9a7bd2e42b29d7dcf360623 (diff)
Move the realloc outside the inner loop. This reduces the number of times
we do the realloc.
Notes
Notes: svn path=/head/; revision=109310
-rw-r--r--usr.sbin/sysinstall/dist.c2
1 files changed, 1 insertions, 1 deletions
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.");