mirror of
https://github.com/sudo-project/sudo.git
synced 2025-08-31 14:25:15 +00:00
Better handling of setlocale() returning NULL.
This commit is contained in:
@@ -84,7 +84,9 @@ sudoers_setlocale(int newlocale, int *prevlocale)
|
||||
current_locale = SUDOERS_LOCALE_USER;
|
||||
res = setlocale(LC_ALL, user_locale ? user_locale : "");
|
||||
if (res != NULL && user_locale == NULL) {
|
||||
user_locale = strdup(setlocale(LC_ALL, NULL));
|
||||
user_locale = setlocale(LC_ALL, NULL);
|
||||
if (user_locale != NULL)
|
||||
user_locale = strdup(user_locale);
|
||||
if (user_locale == NULL)
|
||||
res = NULL;
|
||||
}
|
||||
|
Reference in New Issue
Block a user