Fixed crashing in release builds

This commit is contained in:
artdeell 2022-10-09 23:12:50 +03:00
parent 374da2a7f8
commit ec10409e7e

View File

@ -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{