refactor: replace potentially unsafe string functions with snprintf

This commit is contained in:
frosty
2026-10-27 20:31:28 -04:00
parent bd3da22325
commit 250898c638
10 changed files with 78 additions and 63 deletions

View File

@@ -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);
}
}