mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-31 12:24:10 -08:00
C: fix GC hanging when main function receives 0 for argc
This commit is contained in:
parent
aeb5f44922
commit
c28d9ef68d
|
@ -459,7 +459,7 @@ char* teavm_char16ToMb(char16_t* javaChars, int32_t length) {
|
||||||
}
|
}
|
||||||
|
|
||||||
TeaVM_Array* teavm_parseArguments(int argc, char** argv) {
|
TeaVM_Array* teavm_parseArguments(int argc, char** argv) {
|
||||||
TeaVM_Array* array = teavm_allocateStringArray(argc - 1);
|
TeaVM_Array* array = teavm_allocateStringArray(max(argc - 1, 0));
|
||||||
TeaVM_String** arrayData = TEAVM_ARRAY_DATA(array, TeaVM_String*);
|
TeaVM_String** arrayData = TEAVM_ARRAY_DATA(array, TeaVM_String*);
|
||||||
for (int i = 1; i < argc; ++i) {
|
for (int i = 1; i < argc; ++i) {
|
||||||
arrayData[i - 1] = teavm_cToString(argv[i]);
|
arrayData[i - 1] = teavm_cToString(argv[i]);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user