2
0
mirror of https://github.com/FWGS/xash3d-fwgs synced 2024-11-27 04:11:08 +01:00

engine: android: get rid of VLA

This commit is contained in:
Alibek Omarov 2019-10-05 03:33:13 +03:00
parent 67cdbef833
commit 6e2dbd4e1c

View File

@ -220,7 +220,7 @@ DECLARE_JNI_INTERFACE( int, nativeInit, jobject array )
/* Prepare the arguments. */ /* Prepare the arguments. */
int len = (*env)->GetArrayLength(env, array); int len = (*env)->GetArrayLength(env, array);
char* argv[1 + len + 1]; char** argv = calloc( 1 + len + 1, sizeof( char ** ));
argc = 0; argc = 0;
argv[argc++] = strdup("app_process"); argv[argc++] = strdup("app_process");
for (i = 0; i < len; ++i) { for (i = 0; i < len; ++i) {
@ -267,6 +267,7 @@ DECLARE_JNI_INTERFACE( int, nativeInit, jobject array )
for (i = 0; i < argc; ++i) for (i = 0; i < argc; ++i)
free(argv[i]); free(argv[i]);
free(argv);
return status; return status;
} }