mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-13 06:39:54 -04:00
Fixed crashing in release builds
This commit is contained in:
parent
374da2a7f8
commit
ec10409e7e
@ -12,10 +12,7 @@ __attribute__((constructor)) void env_init() {
|
||||
char* strptr_env = getenv("POJAV_ENVIRON");
|
||||
if(strptr_env == NULL) {
|
||||
__android_log_print(ANDROID_LOG_INFO, "Environ", "No environ found, creating...");
|
||||
pojav_environ = malloc(sizeof(struct pojav_environ_s));
|
||||
assert(pojav_environ);
|
||||
memset(pojav_environ, 0 , sizeof(struct pojav_environ_s));
|
||||
assert(asprintf(&strptr_env, "%p", pojav_environ) != -1);
|
||||
if(asprintf(&strptr_env, "%p", pojav_environ) == -1) abort();
|
||||
setenv("POJAV_ENVIRON", strptr_env, 1);
|
||||
free(strptr_env);
|
||||
}else{
|
||||
|
Loading…
x
Reference in New Issue
Block a user