From c119296504b5258f9e44e23b298ea6b6394d6d92 Mon Sep 17 00:00:00 2001 From: Dario Lombardo Date: Thu, 31 Mar 2016 14:08:20 +0200 Subject: randpkt: restyle the list generation to get rid of the const compiler warning. Change-Id: Id7c62ef18f919ba8a476898bc88c02fd3b6bf5a1 Reviewed-on: https://code.wireshark.org/review/14730 Petri-Dish: Dario Lombardo Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann --- randpkt_core/randpkt_core.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'randpkt_core/randpkt_core.c') diff --git a/randpkt_core/randpkt_core.c b/randpkt_core/randpkt_core.c index 21739b082a..85759afb52 100644 --- a/randpkt_core/randpkt_core.c +++ b/randpkt_core/randpkt_core.c @@ -779,15 +779,16 @@ int randpkt_parse_type(char *string) return -1; } -void randpkt_example_list(const char*** abbrev_list, const char*** longname_list, unsigned* list_num) +void randpkt_example_list(char*** abbrev_list, char*** longname_list) { unsigned i; - *list_num = randpkt_example_count(); - *abbrev_list = g_new0(const char*, *list_num); - *longname_list = g_new0(const char*, *list_num); - for (i = 0; i < *list_num; i++) { - (*abbrev_list)[i] = examples[i].abbrev; - (*longname_list)[i] = examples[i].longname; + unsigned list_num; + list_num = randpkt_example_count(); + *abbrev_list = g_new0(char*, list_num + 1); + *longname_list = g_new0(char*, list_num + 1); + for (i = 0; i < list_num; i++) { + (*abbrev_list)[i] = g_strdup(examples[i].abbrev); + (*longname_list)[i] = g_strdup(examples[i].longname); } } -- cgit v1.2.1