From de18a7061c9bdff73d66502c55d6a3ea671fc6d9 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Thu, 5 Sep 2019 22:16:58 +0200 Subject: locale: Avoid zero-length array in _nl_category_names [BZ #24962] The union wrapper is unnecessary because C allows to read any object as a sequence of chars. Reviewed-by: Carlos O'Donell --- locale/findlocale.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'locale/findlocale.c') diff --git a/locale/findlocale.c b/locale/findlocale.c index 9af605bd64..28b0226265 100644 --- a/locale/findlocale.c +++ b/locale/findlocale.c @@ -118,8 +118,7 @@ _nl_find_locale (const char *locale_path, size_t locale_path_len, variables. */ cloc_name = getenv ("LC_ALL"); if (!name_present (cloc_name)) - cloc_name = getenv (_nl_category_names.str - + _nl_category_name_idxs[category]); + cloc_name = getenv (_nl_category_names_get (category)); if (!name_present (cloc_name)) cloc_name = getenv ("LANG"); if (!name_present (cloc_name)) @@ -207,8 +206,7 @@ _nl_find_locale (const char *locale_path, size_t locale_path_len, locale_path, locale_path_len, mask, language, territory, codeset, normalized_codeset, modifier, - _nl_category_names.str - + _nl_category_name_idxs[category], 0); + _nl_category_names_get (category), 0); if (locale_file == NULL) { @@ -218,8 +216,7 @@ _nl_find_locale (const char *locale_path, size_t locale_path_len, locale_path, locale_path_len, mask, language, territory, codeset, normalized_codeset, modifier, - _nl_category_names.str - + _nl_category_name_idxs[category], 1); + _nl_category_names_get (category), 1); if (locale_file == NULL) /* This means we are out of core. */ return NULL; -- cgit 1.4.1