diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-03-07 14:28:28 -0500 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-03-07 14:28:28 -0500 |
| commit | bae4ae1a6afa4516ef0e5349471d572663c6ad1f (patch) | |
| tree | 8164072e24dfc592a22aee02babecb967a4cbd93 /stdlib | |
| parent | 3ea8540ec6ea689cc36a2b134879bd14c11888e0 (diff) | |
Correctly set locale when starting the program
Diffstat (limited to 'stdlib')
| -rw-r--r-- | stdlib/stdlib.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/stdlib/stdlib.c b/stdlib/stdlib.c index bf17aaf4..a2c08ff0 100644 --- a/stdlib/stdlib.c +++ b/stdlib/stdlib.c @@ -4,6 +4,7 @@ #include <execinfo.h> #include <fcntl.h> #include <gc.h> +#include <locale.h> #include <stdbool.h> #include <stdint.h> #include <stdlib.h> @@ -47,6 +48,8 @@ public void tomo_init(void) USE_COLOR = getenv("COLOR") ? strcmp(getenv("COLOR"), "1") == 0 : isatty(STDOUT_FILENO); if (getenv("NO_COLOR") && getenv("NO_COLOR")[0] != '\0') USE_COLOR = false; + + setlocale(LC_ALL, ""); getrandom(TOMO_HASH_KEY, sizeof(TOMO_HASH_KEY), 0); int rng_fd = open("/dev/urandom", O_RDONLY); |
