* lib/localename-unsafe.c (get_lcid): Don't overrun the last_locale array.
+2025-12-10 Bruno Haible <bruno@clisp.org>
+
+ localename-unsafe: Improve Windows LCID lookup cache.
+ * lib/localename-unsafe.c (get_lcid): Don't overrun the last_locale array.
+
2025-12-10 Bruno Haible <bruno@clisp.org>
canonicalize-lgpl: Fix UMR introduced in recent change.
{
/* A simple cache. */
static LCID last_lcid;
- static char last_locale[1000];
+ static char last_locale[sizeof (lname)];
/* Lock while looking for an LCID, to protect access to static
variables: last_lcid, last_locale, found_lcid, and lname. */
if (found_lcid > 0)
{
last_lcid = found_lcid;
- strcpy (last_locale, locale_name);
+ strcpy (last_locale, lname);
}
glwthread_mutex_unlock (&get_lcid_lock);
return found_lcid;