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:
parent
67cdbef833
commit
6e2dbd4e1c
@ -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;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user