diff --git a/usr.sbin/bsdinstall/distfetch/distfetch.c b/usr.sbin/bsdinstall/distfetch/distfetch.c --- a/usr.sbin/bsdinstall/distfetch/distfetch.c +++ b/usr.sbin/bsdinstall/distfetch/distfetch.c @@ -101,8 +101,9 @@ bsddialog_end(); free(diststring); - for (i = 0; i < ndists; i++) + for (i = 0; i < ndists; i++) { free(urls[i]); + } free(urls); return ((nfetched == ndists) ? EXIT_SUCCESS : EXIT_FAILURE); diff --git a/usr.sbin/bsdinstall/partedit/gpart_ops.c b/usr.sbin/bsdinstall/partedit/gpart_ops.c --- a/usr.sbin/bsdinstall/partedit/gpart_ops.c +++ b/usr.sbin/bsdinstall/partedit/gpart_ops.c @@ -368,9 +368,10 @@ gctl_ro_param(r, "index", sizeof(idx), &idx); errstr = gctl_issue(r); - if (errstr != NULL && errstr[0] != '\0') + if (errstr != NULL && errstr[0] != '\0') { gpart_show_error("Error", "Error marking partition active:", errstr); + } gctl_free(r); } @@ -388,9 +389,10 @@ gctl_ro_param(r, "attrib", -1, attribute); errstr = gctl_issue(r); - if (errstr != NULL && errstr[0] != '\0') + if (errstr != NULL && errstr[0] != '\0') { gpart_show_error("Error", "Error setting parameter on disk:", errstr); + } gctl_free(r); } @@ -418,8 +420,9 @@ } bootcode = bootcode_path(scheme); - if (bootcode == NULL) + if (bootcode == NULL) { return; + } bootfd = open(bootcode, O_RDONLY); if (bootfd < 0) { @@ -444,8 +447,9 @@ gctl_ro_param(r, "bootcode", bootsize, boot); errstr = gctl_issue(r); - if (errstr != NULL && errstr[0] != '\0') + if (errstr != NULL && errstr[0] != '\0') { gpart_show_error("Bootcode Error", NULL, errstr); + } gctl_free(r); free(boot); } @@ -1071,9 +1075,10 @@ /* Now get the partition scheme */ scheme = NULL; if (geom != NULL) { - LIST_FOREACH(gc, &geom->lg_config, lg_config) + LIST_FOREACH(gc, &geom->lg_config, lg_config) { if (strcmp(gc->lg_name, "scheme") == 0) scheme = gc->lg_val; + } } if (geom == NULL || scheme == NULL || strcmp(scheme, "(none)") == 0) { @@ -1268,9 +1273,10 @@ if (bytes > 0) { firstfree += bytes / sector; size -= (bytes + stripe)/sector; - if (stripe > 0 && (firstfree*sector % stripe) != 0) + if (stripe > 0 && (firstfree*sector % stripe) != 0) { firstfree += (stripe - ((firstfree*sector) % stripe)) / sector; + } } } @@ -1536,8 +1542,9 @@ gctl_ro_param(r, "verb", -1, "commit"); errstr = gctl_issue(r); - if (errstr != NULL && errstr[0] != '\0') + if (errstr != NULL && errstr[0] != '\0') { gpart_show_error("Error", NULL, errstr); + } gctl_free(r); } } diff --git a/usr.sbin/bsdinstall/partedit/partedit.c b/usr.sbin/bsdinstall/partedit/partedit.c --- a/usr.sbin/bsdinstall/partedit/partedit.c +++ b/usr.sbin/bsdinstall/partedit/partedit.c @@ -236,9 +236,11 @@ { struct partition_metadata *md; - TAILQ_FOREACH(md, &part_metadata, metadata) - if (md->name != NULL && strcmp(md->name, name) == 0) + TAILQ_FOREACH(md, &part_metadata, metadata) { + if (md->name != NULL && strcmp(md->name, name) == 0) { break; + } + } if (md == NULL && create) { md = calloc(1, sizeof(*md)); @@ -300,7 +302,7 @@ } /* - * Check for root partitions that we aren't formatting, which is + * Check for root partitions that we aren't formatting, which is * usually a mistake */ if (root->newfs == NULL && !sade_mode) { @@ -378,8 +380,9 @@ miniperc[i] = BSDDIALOG_MG_COMPLETED; i++; - if (getenv("BSDINSTALL_LOG") == NULL) + if (getenv("BSDINSTALL_LOG") == NULL) { setenv("BSDINSTALL_LOG", "/dev/null", 1); + } TAILQ_FOREACH(md, &part_metadata, metadata) { if (md->newfs != NULL) { @@ -513,8 +516,9 @@ continue; /* Now recurse into all children */ - LIST_FOREACH(gp, &classp->lg_geom, lg_geom) + LIST_FOREACH(gp, &classp->lg_geom, lg_geom) { add_geom_children(gp, 0, &items, nitems); + } } return (items); @@ -536,8 +540,9 @@ } } - if (LIST_EMPTY(&gp->lg_provider)) + if (LIST_EMPTY(&gp->lg_provider)) { return; + } LIST_FOREACH(pp, &gp->lg_provider, lg_provider) { if (strcmp(gp->lg_class->lg_name, "LABEL") == 0) diff --git a/usr.sbin/bsdinstall/partedit/partedit_x86.c b/usr.sbin/bsdinstall/partedit/partedit_x86.c --- a/usr.sbin/bsdinstall/partedit/partedit_x86.c +++ b/usr.sbin/bsdinstall/partedit/partedit_x86.c @@ -101,10 +101,12 @@ if (strcmp(scheme, "GPT") != 0) return (0); - if (strcmp(x86_bootmethod(), "BIOS") == 0) + if (strcmp(x86_bootmethod(), "BIOS") == 0) { return (512*1024); - else + } + else { return (EFI_BOOTPART_SIZE); + } return (0); } diff --git a/usr.sbin/bsdinstall/scripts/script b/usr.sbin/bsdinstall/scripts/script --- a/usr.sbin/bsdinstall/scripts/script +++ b/usr.sbin/bsdinstall/scripts/script @@ -138,7 +138,7 @@ # no option to ignore this (distextract ignores them internally # through a hack), and returns 1 on any warning or error, # effectively turning all warnings into fatal errors. - # + # # Work around this in an extremely lame way for the specific # case of EFI system partitions only. This *ONLY WORKS* if # /boot/efi is empty and does not handle analagous problems on diff --git a/usr.sbin/bsdinstall/startbsdinstall b/usr.sbin/bsdinstall/startbsdinstall --- a/usr.sbin/bsdinstall/startbsdinstall +++ b/usr.sbin/bsdinstall/startbsdinstall @@ -54,7 +54,7 @@ else bsddialog --backtitle "FreeBSD Installer" --title "Error" --textbox /tmp/bsdinstall_log 0 0 fi - exit + exit fi bsddialog --backtitle "FreeBSD Installer" --title "Welcome" --extra-button --extra-label "Shell" --ok-label "Install" --cancel-label "Live CD" --yesno "Welcome to FreeBSD! Would you like to begin an installation or use the live CD?" 0 0