0005-Avoid-initialization-of-flexible-array-in-struct.patch (3467B)
- From ebf2fe8b09eb71a148800bdae671dfb00befc02c Mon Sep 17 00:00:00 2001
- From: Michael Forney <mforney@mforney.org>
- Date: Mon, 24 Jun 2019 22:48:57 -0700
- Subject: [PATCH] Avoid initialization of flexible array in struct
- ---
- disk-utils/fdisk-menu.c | 18 +++++++++---------
- 1 file changed, 9 insertions(+), 9 deletions(-)
- diff --git a/disk-utils/fdisk-menu.c b/disk-utils/fdisk-menu.c
- index 4e5801bce..979f32e83 100644
- --- a/disk-utils/fdisk-menu.c
- +++ b/disk-utils/fdisk-menu.c
- @@ -46,7 +46,7 @@ struct menu {
- const struct menu *,
- const struct menu_entry *);
- - struct menu_entry entries[]; /* NULL terminated array */
- + struct menu_entry *entries; /* NULL terminated array */
- };
- struct menu_context {
- @@ -101,7 +101,7 @@ DECLARE_MENU_CB(generic_menu_cb);
- /* Generic menu */
- static const struct menu menu_generic = {
- .callback = generic_menu_cb,
- - .entries = {
- + .entries = (struct menu_entry[]){
- MENU_BSEP(N_("Generic")),
- MENU_ENT ('d', N_("delete a partition")),
- MENU_ENT ('F', N_("list free unpartitioned space")),
- @@ -145,7 +145,7 @@ static const struct menu menu_createlabel = {
- .callback = createlabel_menu_cb,
- .exclude = FDISK_DISKLABEL_BSD,
- .nonested = 1,
- - .entries = {
- + .entries = (struct menu_entry[]){
- MENU_SEP(N_("Create a new label")),
- MENU_ENT('g', N_("create a new empty GPT partition table")),
- MENU_ENT('G', N_("create a new empty SGI (IRIX) partition table")),
- @@ -162,7 +162,7 @@ static const struct menu menu_createlabel = {
- static const struct menu menu_geo = {
- .callback = geo_menu_cb,
- .exclude = FDISK_DISKLABEL_GPT | FDISK_DISKLABEL_BSD,
- - .entries = {
- + .entries = (struct menu_entry[]){
- MENU_XSEP(N_("Geometry (for the current label)")),
- MENU_XENT('c', N_("change number of cylinders")),
- MENU_XENT('h', N_("change number of heads")),
- @@ -174,7 +174,7 @@ static const struct menu menu_geo = {
- static const struct menu menu_gpt = {
- .callback = gpt_menu_cb,
- .label = FDISK_DISKLABEL_GPT,
- - .entries = {
- + .entries = (struct menu_entry[]){
- MENU_BSEP(N_("GPT")),
- MENU_XENT('i', N_("change disk GUID")),
- MENU_XENT('n', N_("change partition name")),
- @@ -195,7 +195,7 @@ static const struct menu menu_gpt = {
- static const struct menu menu_sun = {
- .callback = sun_menu_cb,
- .label = FDISK_DISKLABEL_SUN,
- - .entries = {
- + .entries = (struct menu_entry[]){
- MENU_BSEP(N_("Sun")),
- MENU_ENT('a', N_("toggle the read-only flag")),
- MENU_ENT('c', N_("toggle the mountable flag")),
- @@ -212,7 +212,7 @@ static const struct menu menu_sun = {
- static const struct menu menu_sgi = {
- .callback = sgi_menu_cb,
- .label = FDISK_DISKLABEL_SGI,
- - .entries = {
- + .entries = (struct menu_entry[]){
- MENU_SEP(N_("SGI")),
- MENU_ENT('a', N_("select bootable partition")),
- MENU_ENT('b', N_("edit bootfile entry")),
- @@ -225,7 +225,7 @@ static const struct menu menu_sgi = {
- static const struct menu menu_dos = {
- .callback = dos_menu_cb,
- .label = FDISK_DISKLABEL_DOS,
- - .entries = {
- + .entries = (struct menu_entry[]){
- MENU_BSEP(N_("DOS (MBR)")),
- MENU_ENT('a', N_("toggle a bootable flag")),
- MENU_ENT('b', N_("edit nested BSD disklabel")),
- @@ -244,7 +244,7 @@ static const struct menu menu_dos = {
- static const struct menu menu_bsd = {
- .callback = bsd_menu_cb,
- .label = FDISK_DISKLABEL_BSD,
- - .entries = {
- + .entries = (struct menu_entry[]){
- MENU_SEP(N_("BSD")),
- MENU_ENT('e', N_("edit drive data")),
- MENU_ENT('i', N_("install bootstrap")),
- --
- 2.49.0