C: fix compilation in Linux

This commit is contained in:
Alexey Andreev 2019-06-17 15:58:19 +03:00
parent 9642eeec0a
commit 00ca2c1064

View File

@ -59,8 +59,9 @@ int32_t teavm_file_workDirectory(char16_t** result) {
} }
int32_t teavm_file_tempDirectory(char16_t** result) { int32_t teavm_file_tempDirectory(char16_t** result) {
static const char16_t tmp[] = u"/tmp"; static const char16_t string[] = u"/tmp";
*result = malloc(sizeof(tmp)); char16_t* copy = malloc(sizeof(string));
*result = copy;
int32_t i = 0; int32_t i = 0;
while (string[i] != 0) { while (string[i] != 0) {
copy[i] = string[i]; copy[i] = string[i];