-/* $OpenBSD: cmd.c,v 1.168 2023/03/25 15:05:45 krw Exp $ */
+/* $OpenBSD: cmd.c,v 1.169 2023/03/25 15:58:44 krw Exp $ */
/*
* Copyright (c) 1997 Tobias Weingartner
if (strlen(lbuf) == 0)
return dflt;
if (strcmp(lbuf, "?") == 0) {
- PRT_print_mbrtypes();
+ PRT_print_mbrmenu();
continue;
}
string_from_line(lbuf, sizeof(lbuf), TRIMMED);
if (strcmp(lbuf, "?") == 0) {
- PRT_print_gpttypes();
+ PRT_print_gptmenu();
continue;
} else if (strlen(lbuf) == 0) {
uuid = *olduuid;
-/* $OpenBSD: part.c,v 1.133 2023/03/25 15:05:45 krw Exp $ */
+/* $OpenBSD: part.c,v 1.134 2023/03/25 15:58:44 krw Exp $ */
/*
* Copyright (c) 1997 Tobias Weingartner
#include "gpt.h"
struct mbr_type {
- int mt_type;
- char mt_name[14];
+ int mt_type;
+ char *mt_name;
};
const struct mbr_type mbr_types[] = {
};
struct gpt_type {
- int gt_type;
- int gt_attr;
+ int gt_type;
+ int gt_attr;
#define GTATTR_PROTECT (1 << 0)
#define GTATTR_PROTECT_EFISYS (1 << 1)
- char gt_name[14];
- char gt_guid[UUID_STR_LEN + 1];
+ char *gt_name;
+ char gt_guid[UUID_STR_LEN + 1];
};
const struct gpt_type gpt_types[] = {
}
void
-PRT_print_mbrtypes(void)
+PRT_print_mbrmenu(void)
{
unsigned int cidx, i, idrows;
printf("Choose from the following Partition id values:\n");
for (i = 0; i < idrows; i++) {
for (cidx = i; cidx < i + idrows * 3; cidx += idrows) {
- printf("%02X %-*s", mbr_types[cidx].mt_type,
- (int)sizeof(mbr_types[cidx].mt_name) + 1,
+ printf("%02X %-15s", mbr_types[cidx].mt_type,
mbr_types[cidx].mt_name);
}
if (cidx < nitems(mbr_types))
}
void
-PRT_print_gpttypes(void)
+PRT_print_gptmenu(void)
{
unsigned int cidx, i, idrows;
printf("Choose from the following Partition id values:\n");
for (i = 0; i < idrows; i++) {
for (cidx = i; cidx < i + idrows * 3; cidx += idrows) {
- printf("%02X %-*s", gpt_types[cidx].gt_type,
- (int)sizeof(gpt_types[cidx].gt_name) + 1,
+ printf("%02X %-15s", gpt_types[cidx].gt_type,
gpt_types[cidx].gt_name);
}
if (cidx < nitems(gpt_types))
-/* $OpenBSD: part.h,v 1.39 2023/03/25 15:05:45 krw Exp $ */
+/* $OpenBSD: part.h,v 1.40 2023/03/25 15:58:44 krw Exp $ */
/*
* Copyright (c) 1997 Tobias Weingartner
unsigned char prt_id;
};
-void PRT_print_mbrtypes(void);
-void PRT_print_gpttypes(void);
+void PRT_print_mbrmenu(void);
+void PRT_print_gptmenu(void);
void PRT_parse(const struct dos_partition *, const uint64_t,
const uint64_t, struct prt *);
void PRT_make(const struct prt *,const uint64_t, const uint64_t,