refactor: replace potentially unsafe string functions with snprintf
This commit is contained in:
@@ -89,8 +89,8 @@ void get_available_themes(char ***out_themes, int *out_count) {
|
||||
|
||||
void set_default_locale(const char *locale) {
|
||||
if (locale && strlen(locale) > 0) {
|
||||
strncpy(global_default_locale, locale, sizeof(global_default_locale) - 1);
|
||||
global_default_locale[sizeof(global_default_locale) - 1] = '\0';
|
||||
snprintf(global_default_locale, sizeof(global_default_locale), "%s",
|
||||
locale);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user