linux-qubasis

linux oasis port as a qubes template

git clone https://9o.is/git/linux-qubasis.git

0006-Avoid-initialization-of-flexible-array-in-struct.patch

(3465B)


      1 From 56273e92326b26a326c73e47b3d5929bbce9ac03 Mon Sep 17 00:00:00 2001
      2 From: Michael Forney <mforney@mforney.org>
      3 Date: Mon, 24 Jun 2019 22:48:57 -0700
      4 Subject: [PATCH] Avoid initialization of flexible array in struct
      5 
      6 ---
      7  disk-utils/fdisk-menu.c | 18 +++++++++---------
      8  1 file changed, 9 insertions(+), 9 deletions(-)
      9 
     10 diff --git a/disk-utils/fdisk-menu.c b/disk-utils/fdisk-menu.c
     11 index 71355f684..fb5b2e253 100644
     12 --- a/disk-utils/fdisk-menu.c
     13 +++ b/disk-utils/fdisk-menu.c
     14 @@ -37,7 +37,7 @@ struct menu {
     15  			const struct menu *,
     16  			const struct menu_entry *);
     17  
     18 -	struct menu_entry	entries[];	/* NULL terminated array */
     19 +	struct menu_entry	*entries;	/* NULL terminated array */
     20  };
     21  
     22  struct menu_context {
     23 @@ -92,7 +92,7 @@ DECLARE_MENU_CB(generic_menu_cb);
     24  /* Generic menu */
     25  static const struct menu menu_generic = {
     26  	.callback	= generic_menu_cb,
     27 -	.entries	= {
     28 +	.entries	= (struct menu_entry[]){
     29  		MENU_BSEP(N_("Generic")),
     30  		MENU_ENT  ('d', N_("delete a partition")),
     31  		MENU_ENT  ('F', N_("list free unpartitioned space")),
     32 @@ -134,7 +134,7 @@ static const struct menu menu_createlabel = {
     33  	.callback = createlabel_menu_cb,
     34  	.exclude = FDISK_DISKLABEL_BSD,
     35  	.nonested = 1,
     36 -	.entries = {
     37 +	.entries = (struct menu_entry[]){
     38  		MENU_SEP(N_("Create a new label")),
     39  		MENU_ENT('g', N_("create a new empty GPT partition table")),
     40  		MENU_ENT('G', N_("create a new empty SGI (IRIX) partition table")),
     41 @@ -151,7 +151,7 @@ static const struct menu menu_createlabel = {
     42  static const struct menu menu_geo = {
     43  	.callback = geo_menu_cb,
     44  	.exclude = FDISK_DISKLABEL_GPT | FDISK_DISKLABEL_BSD,
     45 -	.entries = {
     46 +	.entries = (struct menu_entry[]){
     47  		MENU_XSEP(N_("Geometry (for the current label)")),
     48  		MENU_XENT('c', N_("change number of cylinders")),
     49  		MENU_XENT('h', N_("change number of heads")),
     50 @@ -163,7 +163,7 @@ static const struct menu menu_geo = {
     51  static const struct menu menu_gpt = {
     52  	.callback = gpt_menu_cb,
     53  	.label = FDISK_DISKLABEL_GPT,
     54 -	.entries = {
     55 +	.entries = (struct menu_entry[]){
     56  		MENU_BSEP(N_("GPT")),
     57  		MENU_XENT('i', N_("change disk GUID")),
     58  		MENU_XENT('n', N_("change partition name")),
     59 @@ -184,7 +184,7 @@ static const struct menu menu_gpt = {
     60  static const struct menu menu_sun = {
     61  	.callback = sun_menu_cb,
     62  	.label = FDISK_DISKLABEL_SUN,
     63 -	.entries = {
     64 +	.entries = (struct menu_entry[]){
     65  		MENU_BSEP(N_("Sun")),
     66  		MENU_ENT('a', N_("toggle the read-only flag")),
     67  		MENU_ENT('c', N_("toggle the mountable flag")),
     68 @@ -201,7 +201,7 @@ static const struct menu menu_sun = {
     69  static const struct menu menu_sgi = {
     70  	.callback = sgi_menu_cb,
     71  	.label = FDISK_DISKLABEL_SGI,
     72 -	.entries = {
     73 +	.entries = (struct menu_entry[]){
     74  		MENU_SEP(N_("SGI")),
     75  		MENU_ENT('a', N_("select bootable partition")),
     76  		MENU_ENT('b', N_("edit bootfile entry")),
     77 @@ -214,7 +214,7 @@ static const struct menu menu_sgi = {
     78  static const struct menu menu_dos = {
     79  	.callback = dos_menu_cb,
     80  	.label = FDISK_DISKLABEL_DOS,
     81 -	.entries = {
     82 +	.entries = (struct menu_entry[]){
     83  		MENU_BSEP(N_("DOS (MBR)")),
     84  		MENU_ENT('a', N_("toggle a bootable flag")),
     85  		MENU_ENT('b', N_("edit nested BSD disklabel")),
     86 @@ -232,7 +232,7 @@ static const struct menu menu_dos = {
     87  static const struct menu menu_bsd = {
     88  	.callback = bsd_menu_cb,
     89  	.label = FDISK_DISKLABEL_BSD,
     90 -	.entries = {
     91 +	.entries = (struct menu_entry[]){
     92  		MENU_SEP(N_("BSD")),
     93  		MENU_ENT('e', N_("edit drive data")),
     94  		MENU_ENT('i', N_("install bootstrap")),
     95 -- 
     96 2.25.0
     97