Skip to content

Commit 6f17cfd

Browse files
author
Matthias Arzt
committed
- fix segmentation fault on windows when OPENMODELICAHOME is not set.
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@16611 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
1 parent 98c9cf3 commit 6f17cfd

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Compiler/runtime/systemimpl.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1905,6 +1905,11 @@ void SystemImpl__gettextInit(const char *locale)
19051905
}
19061906
free(old_ctype);
19071907
#endif /* __MINGW32__ */
1908+
if(omhome == NULL)
1909+
{
1910+
fprintf(stderr, "Warning: environment variable OPENMODELICAHOME is not set. Cannot load locale.\n");
1911+
return;
1912+
}
19081913
omlen = strlen(omhome);
19091914
localedir = (char*) malloc(omlen + 25);
19101915
sprintf(localedir, "%s/share/locale", omhome);

0 commit comments

Comments
 (0)