From 140f8401ad7ca03eac46c72162b06ea7bebcc9c5 Mon Sep 17 00:00:00 2001 From: krw Date: Sat, 17 Jul 2021 21:47:56 +0000 Subject: [PATCH] The first think MBR_init() does is memset(0) the gpt header and gpt partition array. So no need to memset(0) the gpt header before each MBR_init() invocation. No functional change. --- sbin/fdisk/cmd.c | 3 +-- sbin/fdisk/fdisk.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/sbin/fdisk/cmd.c b/sbin/fdisk/cmd.c index aa2ca120351..a86f3e1a16c 100644 --- a/sbin/fdisk/cmd.c +++ b/sbin/fdisk/cmd.c @@ -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"); } diff --git a/sbin/fdisk/fdisk.c b/sbin/fdisk/fdisk.c index 8cb0be0bed0..40dfb517c5c 100644 --- a/sbin/fdisk/fdisk.c +++ b/sbin/fdisk/fdisk.c @@ -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?"; -- 2.20.1