diff options
| author | frosty <frostinator33@airmail.cc> | 2026-10-27 20:31:28 -0400 |
|---|---|---|
| committer | frosty <frostinator33@airmail.cc> | 2026-10-27 20:33:50 -0400 |
| commit | 250898c638f07ace6bc7167faede93113c8fd0db (patch) | |
| tree | 310addbedcaaf76da98df22434a4f4711c8ba963 /src/Utility/Utility.c | |
| parent | bd3da2232540ea4c78e7ac35e2c90c38c8a3c410 (diff) | |
refactor: replace potentially unsafe string functions with snprintf
Diffstat (limited to 'src/Utility/Utility.c')
| -rw-r--r-- | src/Utility/Utility.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Utility/Utility.c b/src/Utility/Utility.c index 35fc491..ed1ff13 100644 --- a/src/Utility/Utility.c +++ b/src/Utility/Utility.c @@ -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); } } |
