aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/rt/rust_internal.h2
-rw-r--r--src/rt/rust_kernel.cpp2
-rw-r--r--src/rt/rust_log.cpp8
-rw-r--r--src/rt/rust_task.cpp2
4 files changed, 8 insertions, 6 deletions
diff --git a/src/rt/rust_internal.h b/src/rt/rust_internal.h
index 9a1b2ec0..61716703 100644
--- a/src/rt/rust_internal.h
+++ b/src/rt/rust_internal.h
@@ -90,7 +90,7 @@ static intptr_t const CONST_REFCOUNT = 0x7badface;
// This accounts for logging buffers.
-static size_t const BUF_BYTES = 1024;
+static size_t const BUF_BYTES = 2048;
// Every reference counted object should derive from this base class.
diff --git a/src/rt/rust_kernel.cpp b/src/rt/rust_kernel.cpp
index 0dc1369d..df6b655a 100644
--- a/src/rt/rust_kernel.cpp
+++ b/src/rt/rust_kernel.cpp
@@ -119,7 +119,7 @@ rust_kernel::is_deadlocked() {
void
rust_kernel::log(uint32_t type_bits, char const *fmt, ...) {
- char buf[256];
+ char buf[BUF_BYTES];
if (_log.is_tracing(type_bits)) {
va_list args;
va_start(args, fmt);
diff --git a/src/rt/rust_log.cpp b/src/rt/rust_log.cpp
index d0ba85de..bcd40c36 100644
--- a/src/rt/rust_log.cpp
+++ b/src/rt/rust_log.cpp
@@ -114,7 +114,8 @@ append_string(char *buffer, const char *format, ...) {
if (buffer != NULL && format) {
va_list args;
va_start(args, format);
- vsprintf(buffer + strlen(buffer), format, args);
+ size_t off = strlen(buffer);
+ vsnprintf(buffer + off, BUF_BYTES - off, format, args);
va_end(args);
}
return buffer;
@@ -127,7 +128,8 @@ append_string(char *buffer, rust_log::ansi_color color,
append_string(buffer, "\x1b%s", _foreground_colors[color]);
va_list args;
va_start(args, format);
- vsprintf(buffer + strlen(buffer), format, args);
+ size_t off = strlen(buffer);
+ vsnprintf(buffer + off, BUF_BYTES - off, format, args);
va_end(args);
append_string(buffer, "\x1b[0m");
}
@@ -193,7 +195,7 @@ rust_log::trace_ln(rust_task *task, ansi_color color,
uint32_t type_bits, char *message) {
if (is_tracing(type_bits)) {
if (_use_colors) {
- char buffer[512] = "";
+ char buffer[BUF_BYTES] = "";
append_string(buffer, color, "%s", message);
trace_ln(task, buffer);
} else {
diff --git a/src/rt/rust_task.cpp b/src/rt/rust_task.cpp
index 1522fccc..68882b21 100644
--- a/src/rt/rust_task.cpp
+++ b/src/rt/rust_task.cpp
@@ -631,7 +631,7 @@ rust_task::get_crate_cache(rust_crate const *curr_crate)
void
rust_task::log(uint32_t type_bits, char const *fmt, ...) {
- char buf[256];
+ char buf[BUF_BYTES];
if (dom->get_log().is_tracing(type_bits)) {
va_list args;
va_start(args, fmt);