From 6b73edd95d603e27d55d4905134ac1327d426534 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Mon, 27 Mar 2017 21:41:36 +0200 Subject: New upstream version 0.9.7 --- lib/localename.c | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) (limited to 'lib/localename.c') diff --git a/lib/localename.c b/lib/localename.c index f8cf3f23..a0752ede 100644 --- a/lib/localename.c +++ b/lib/localename.c @@ -1,11 +1,20 @@ /* Determine name of the currently selected locale. - Copyright (C) 1995-2015 Free Software Foundation, Inc. + Copyright (C) 1995-2016 Free Software Foundation, Inc. - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. + This program is free software: you can redistribute it and/or + modify it under the terms of either: + * the GNU Lesser General Public License as published by the Free + Software Foundation; either version 3 of the License, or (at your + option) any later version. + + or + + * the GNU General Public License as published by the Free + Software Foundation; either version 2 of the License, or (at your + option) any later version. + + or both in parallel, as here. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -33,12 +42,16 @@ #include #include +#include "flexmember.h" + #if HAVE_USELOCALE /* Mac OS X 10.5 defines the locale_t type in . */ # if defined __APPLE__ && defined __MACH__ # include # endif -# include +# if __GLIBC__ >= 2 && !defined __UCLIBC__ +# include +# endif # if !defined IN_LIBINTL # include "glthread/lock.h" # endif @@ -2617,7 +2630,7 @@ string_hash (const void *x) struct hash_node { struct hash_node * volatile next; - char contents[100]; /* has variable size */ + char contents[FLEXIBLE_ARRAY_MEMBER]; }; # define HASH_TABLE_SIZE 257 @@ -2644,7 +2657,7 @@ struniq (const char *string) size = strlen (string) + 1; new_node = (struct hash_node *) - malloc (offsetof (struct hash_node, contents[0]) + size); + malloc (FLEXSIZEOF (struct hash_node, contents, size)); if (new_node == NULL) /* Out of memory. Return a statically allocated string. */ return "C"; -- cgit v1.2.3