summaryrefslogtreecommitdiff
path: root/pkg/util-linux/patch/0006-Avoid-initialization-of-flexible-array-in-struct.patch
blob: d29abb2f12904f5bf79595d05060c19bf97d6400 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
From 56273e92326b26a326c73e47b3d5929bbce9ac03 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 71355f684..fb5b2e253 100644
--- a/disk-utils/fdisk-menu.c
+++ b/disk-utils/fdisk-menu.c
@@ -37,7 +37,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 {
@@ -92,7 +92,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")),
@@ -134,7 +134,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")),
@@ -151,7 +151,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")),
@@ -163,7 +163,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")),
@@ -184,7 +184,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")),
@@ -201,7 +201,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")),
@@ -214,7 +214,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")),
@@ -232,7 +232,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.25.0