diff options
author | obrien <obrien@FreeBSD.org> | 2003-01-15 16:10:29 +0000 |
---|---|---|
committer | obrien <obrien@FreeBSD.org> | 2003-01-15 16:10:29 +0000 |
commit | 6d7f9104bc67e6a245d6c9631b0543a2f6f7c7f5 (patch) | |
tree | 0fad0df5da9fb052341e485282969dc3b14becfd /usr.sbin | |
parent | 62b3c18cd949658adf9712ba32fedee3f7cf5855 (diff) | |
download | FreeBSD-src-6d7f9104bc67e6a245d6c9631b0543a2f6f7c7f5.zip FreeBSD-src-6d7f9104bc67e6a245d6c9631b0543a2f6f7c7f5.tar.gz |
Move the realloc outside the inner loop. This reduces the number of times
we do the realloc.
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/sysinstall/dist.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.sbin/sysinstall/dist.c b/usr.sbin/sysinstall/dist.c index c6fc39f..0177929 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."); |