mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-18 16:27:34 +01:00
[Ion] Prevent crash if locale is null (#365)
* fix a compilation issue * revert file --------- Co-authored-by: Leviathan3DPrinting <leviathan3dprinting@gmail.com>
This commit is contained in:
committed by
GitHub
parent
891693abe2
commit
ac71576acc
@@ -8,7 +8,7 @@ namespace Platform {
|
||||
const char * languageCode() {
|
||||
static char buffer[3] = {0};
|
||||
char * locale = setlocale(LC_ALL, "");
|
||||
if (locale[2] == '_') {
|
||||
if (locale && locale[2] == '_') { // Check if locale is not null before accessing its elements
|
||||
buffer[0] = locale[0];
|
||||
buffer[1] = locale[1];
|
||||
return buffer;
|
||||
|
||||
Reference in New Issue
Block a user