The first think MBR_init() does is memset(0) the gpt header and gpt
authorkrw <krw@openbsd.org>
Sat, 17 Jul 2021 21:47:56 +0000 (21:47 +0000)
committerkrw <krw@openbsd.org>
Sat, 17 Jul 2021 21:47:56 +0000 (21:47 +0000)
partition array. So no need to memset(0) the gpt header before each
MBR_init() invocation.

No functional change.

sbin/fdisk/cmd.c
sbin/fdisk/fdisk.c

index aa2ca12..a86f3e1 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: cmd.c,v 1.131 2021/07/17 14:16:34 krw Exp $   */
+/*     $OpenBSD: cmd.c,v 1.132 2021/07/17 21:47:56 krw Exp $   */
 
 /*
  * Copyright (c) 1997 Tobias Weingartner
@@ -73,7 +73,6 @@ Xreinit(char *args, struct mbr *mbr)
                GPT_init(GHANDGP);
                GPT_print("s", TERSE);
        } else {
-               memset(&gh, 0, sizeof(gh));
                MBR_init(mbr);
                MBR_print(mbr, "s");
        }
index 8cb0be0..40dfb51 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: fdisk.c,v 1.123 2021/07/17 14:16:34 krw Exp $ */
+/*     $OpenBSD: fdisk.c,v 1.124 2021/07/17 21:47:56 krw Exp $ */
 
 /*
  * Copyright (c) 1997 Tobias Weingartner
@@ -209,7 +209,6 @@ main(int argc, char *argv[])
                        GPT_init(GHANDGP);
                        query = "Do you wish to write new GPT?";
                } else {
-                       memset(&gh, 0, sizeof(gh));
                        MBR_init(&initial_mbr);
                        query = "Do you wish to write new MBR and "
                            "partition table?";