Page MenuHomeFreeBSD

D9942.id26111.diff
No OneTemporary

D9942.id26111.diff

Index: usr.sbin/bsdinstall/partedit/gpart_ops.c
===================================================================
--- usr.sbin/bsdinstall/partedit/gpart_ops.c
+++ usr.sbin/bsdinstall/partedit/gpart_ops.c
@@ -99,14 +99,14 @@
if (!use_default) {
int choice;
choice = dlg_checklist("UFS Options", "", 0, 0, 0,
- sizeof(items)/sizeof(items[0]), items, NULL,
+ nitems(items), items, NULL,
FLAG_CHECK, &i);
if (choice == 1) /* Cancel */
return;
}
strcpy(command, "newfs ");
- for (i = 0; i < (int)(sizeof(items)/sizeof(items[0])); i++) {
+ for (i = 0; i < (int)(nitems(items)); i++) {
if (items[i].state == 0)
continue;
if (strcmp(items[i].name, "UFS1") == 0)
@@ -137,7 +137,7 @@
if (!use_default) {
int choice;
choice = dlg_checklist("ZFS Options", "", 0, 0, 0,
- sizeof(items)/sizeof(items[0]), items, NULL,
+ nitems(items), items, NULL,
FLAG_CHECK, &i);
if (choice == 1) /* Cancel */
return;
@@ -153,7 +153,7 @@
sprintf(command, "%s -o cachefile=%s/zpool.cache ",
command, zfsboot_path);
}
- for (i = 0; i < (int)(sizeof(items)/sizeof(items[0])); i++) {
+ for (i = 0; i < (int)(nitems(items)); i++) {
if (items[i].state == 0)
continue;
if (strcmp(items[i].name, "fletcher4") == 0)
@@ -179,14 +179,14 @@
if (!use_default) {
int choice;
choice = dlg_checklist("FAT Options", "", 0, 0, 0,
- sizeof(items)/sizeof(items[0]), items, NULL,
+ nitems(items), items, NULL,
FLAG_RADIO, &i);
if (choice == 1) /* Cancel */
return;
}
strcpy(command, "newfs_msdos ");
- for (i = 0; i < (int)(sizeof(items)/sizeof(items[0])); i++) {
+ for (i = 0; i < (int)(nitems(items)); i++) {
if (items[i].state == 0)
continue;
if (strcmp(items[i].name, "FAT32") == 0)
@@ -227,7 +227,7 @@
dialog_vars.default_item = __DECONST(char *, def_scheme);
cancel = dlg_menu("Partition Scheme",
"Select a partition scheme for this volume:", 0, 0, 0,
- sizeof(items) / sizeof(items[0]), items, &choice, NULL);
+ nitems(items), items, &choice, NULL);
dialog_vars.default_item = NULL;
if (cancel)
@@ -662,7 +662,7 @@
"freebsd") == 0)
gpart_partition(pp->lg_name, "BSD");
- for (i = 0; i < (sizeof(items) / sizeof(items[0])); i++)
+ for (i = 0; i < (nitems(items)); i++)
if (items[i].text_free)
free(items[i].text);
}
@@ -1200,7 +1200,7 @@
set_default_part_metadata(newpartname, scheme,
items[0].text, items[2].text, newfs);
- for (i = 0; i < (sizeof(items) / sizeof(items[0])); i++)
+ for (i = 0; i < (nitems(items)); i++)
if (items[i].text_free)
free(items[i].text);

File Metadata

Mime Type
text/plain
Expires
Sun, Nov 24, 2:08 PM (18 h, 28 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14823113
Default Alt Text
D9942.id26111.diff (2 KB)

Event Timeline