From 6e2dbd4e1c75f025389ac332824b9df4a80232a1 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Sat, 5 Oct 2019 03:33:13 +0300 Subject: [PATCH] engine: android: get rid of VLA --- engine/platform/android/android.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/engine/platform/android/android.c b/engine/platform/android/android.c index 99b9bf8a..9a74622a 100644 --- a/engine/platform/android/android.c +++ b/engine/platform/android/android.c @@ -220,7 +220,7 @@ DECLARE_JNI_INTERFACE( int, nativeInit, jobject array ) /* Prepare the arguments. */ int len = (*env)->GetArrayLength(env, array); - char* argv[1 + len + 1]; + char** argv = calloc( 1 + len + 1, sizeof( char ** )); argc = 0; argv[argc++] = strdup("app_process"); for (i = 0; i < len; ++i) { @@ -267,6 +267,7 @@ DECLARE_JNI_INTERFACE( int, nativeInit, jobject array ) for (i = 0; i < argc; ++i) free(argv[i]); + free(argv); return status; }