mirror of
https://github.com/Tha14/toxic.git
synced 2024-11-22 20:53:01 +01:00
Add check for setlocale()
In wide char mode it is important to be sure that setlocale() function succeed.
This commit is contained in:
parent
e6a13feae8
commit
12af26b666
@ -50,7 +50,13 @@ static void init_term()
|
||||
{
|
||||
/* Setup terminal */
|
||||
signal(SIGWINCH, on_window_resize);
|
||||
setlocale(LC_ALL, "");
|
||||
#if HAVE_WIDECHAR
|
||||
if (setlocale(LC_ALL, "") == NULL) {
|
||||
printf("Could not set your locale, plese check your locale settings or"
|
||||
"disable wide char support\n");
|
||||
exit(1);
|
||||
}
|
||||
#endif
|
||||
initscr();
|
||||
cbreak();
|
||||
keypad(stdscr, 1);
|
||||
|
Loading…
Reference in New Issue
Block a user