From 842e6edbce3276edfba9fb1047a73c5cc29743ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Tue, 4 Oct 2016 20:45:41 -0700 Subject: [PATCH] Fixed getenv. --- include/bx/os.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/bx/os.h b/include/bx/os.h index 2228e9c..327681d 100644 --- a/include/bx/os.h +++ b/include/bx/os.h @@ -242,6 +242,11 @@ namespace bx len = (uint32_t)strlen(ptr); } bool result = len != 0 && len < *_inOutSize; + if (len < *_inOutSize) + { + strcpy(_out, ptr); + } + *_inOutSize = len; return result; #endif // BX_PLATFORM_