aboutsummaryrefslogtreecommitdiff
path: root/src/rt/rust_log.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/rt/rust_log.cpp')
-rw-r--r--src/rt/rust_log.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/rt/rust_log.cpp b/src/rt/rust_log.cpp
index 74a5d00e..20f3f146 100644
--- a/src/rt/rust_log.cpp
+++ b/src/rt/rust_log.cpp
@@ -8,14 +8,13 @@
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
-#include <alloca.h>
static uint32_t
read_type_bit_mask() {
uint32_t bits = rust_log::ULOG | rust_log::ERR;
char *env_str = getenv("RUST_LOG");
if (env_str) {
- char *str = (char *)alloca(strlen(env_str) + 2);
+ char *str = new char[strlen(env_str) + 2];
str[0] = ',';
strcpy(str + 1, env_str);
@@ -38,6 +37,8 @@ read_type_bit_mask() {
bits |= strstr(str, ",bt") ? rust_log::BT : 0;
bits |= strstr(str, ",all") ? rust_log::ALL : 0;
bits = strstr(str, ",none") ? 0 : bits;
+
+ delete[] str;
}
return bits;
}