summaryrefslogtreecommitdiff
path: root/sbin/fdisk
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2023-06-19 23:11:58 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2023-06-19 23:11:58 +0000
commita4edeb099760d29f2c691b41ff3821b2a80df697 (patch)
treee8a302f817855c83738a9fb8d3d6a7b768ca178f /sbin/fdisk
parent34bac2f056bee2dfd8fa5f5be0be48cde2392ba7 (diff)
"%-Ns\n" is more appropriately "%s\n" to avoid adding extraneous
blanks to the end of the line. Unexpected line wrapping noticed by kettenis@, cause spotted by deraadt@ Nuke an unused variable in passing.
Diffstat (limited to 'sbin/fdisk')
-rw-r--r--sbin/fdisk/gpt.c4
-rw-r--r--sbin/fdisk/part.c5
2 files changed, 4 insertions, 5 deletions
diff --git a/sbin/fdisk/gpt.c b/sbin/fdisk/gpt.c
index ad7f44e497c..65e7e8eeb66 100644
--- a/sbin/fdisk/gpt.c
+++ b/sbin/fdisk/gpt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: gpt.c,v 1.91 2023/05/17 12:59:37 krw Exp $ */
+/* $OpenBSD: gpt.c,v 1.92 2023/06/19 23:11:19 krw Exp $ */
/*
* Copyright (c) 2015 Markus Muller <mmu@grummel.net>
* Copyright (c) 2015 Kenneth R Westerback <krw@openbsd.org>
@@ -455,7 +455,7 @@ GPT_print_part(const unsigned int pn, const char *units, const int verbosity)
printf(" <invalid partition guid> ");
else
printf(" %-36s ", guidstr);
- printf("%-36s\n", name_to_string(pn));
+ printf("%s\n", name_to_string(pn));
free(guidstr);
attrs = gp[pn].gp_attrs;
if (attrs) {
diff --git a/sbin/fdisk/part.c b/sbin/fdisk/part.c
index d925b703a56..1e0a1714341 100644
--- a/sbin/fdisk/part.c
+++ b/sbin/fdisk/part.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: part.c,v 1.163 2023/05/21 17:29:33 krw Exp $ */
+/* $OpenBSD: part.c,v 1.164 2023/06/19 23:11:57 krw Exp $ */
/*
* Copyright (c) 1997 Tobias Weingartner
@@ -1047,14 +1047,13 @@ PRT_print_part(const int num, const struct prt *prt, const char *units)
const char *desc;
struct chs start, end;
double size;
- unsigned int i;
size = units_size(units, prt->prt_ns, &ut);
PRT_lba_to_chs(prt, &start, &end);
desc = find_mbr_desc(find_mbr_type(prt->prt_id));
printf("%c%1d: %.2X %6llu %3u %3u - %6llu %3u %3u [%12llu:%12.0f%s] "
- "%-15s\n", (prt->prt_flag == DOSACTIVE) ? '*' : ' ', num,
+ "%s\n", (prt->prt_flag == DOSACTIVE) ? '*' : ' ', num,
prt->prt_id, start.chs_cyl, start.chs_head, start.chs_sect,
end.chs_cyl, end.chs_head, end.chs_sect,
prt->prt_bs, size, ut->ut_abbr, desc ? desc : "<Unknown ID>");