From 00ca2c1064ac2a3bfe5749065fa7cdcf8836bcc7 Mon Sep 17 00:00:00 2001 From: Alexey Andreev Date: Mon, 17 Jun 2019 15:58:19 +0300 Subject: [PATCH] C: fix compilation in Linux --- core/src/main/resources/org/teavm/backend/c/file.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/src/main/resources/org/teavm/backend/c/file.c b/core/src/main/resources/org/teavm/backend/c/file.c index 4c0400185..b6d7535cf 100644 --- a/core/src/main/resources/org/teavm/backend/c/file.c +++ b/core/src/main/resources/org/teavm/backend/c/file.c @@ -59,8 +59,9 @@ int32_t teavm_file_workDirectory(char16_t** result) { } int32_t teavm_file_tempDirectory(char16_t** result) { - static const char16_t tmp[] = u"/tmp"; - *result = malloc(sizeof(tmp)); + static const char16_t string[] = u"/tmp"; + char16_t* copy = malloc(sizeof(string)); + *result = copy; int32_t i = 0; while (string[i] != 0) { copy[i] = string[i];