"%-Ns\n" is more appropriately "%s\n" to avoid adding extraneous
authorkrw <krw@openbsd.org>
Mon, 19 Jun 2023 23:11:19 +0000 (23:11 +0000)
committerkrw <krw@openbsd.org>
Mon, 19 Jun 2023 23:11:19 +0000 (23:11 +0000)
blanks to the end of the line.

Unexpected line wrapping noticed by kettenis@, cause spotted by deraadt@

Nuke an unused variable in passing.

sbin/fdisk/gpt.c

index ad7f44e..65e7e8e 100644 (file)
@@ -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) {