From 23b1d44be41748882ee9187ba0c3580e3b2f89b1 Mon Sep 17 00:00:00 2001 From: Eric Curtin Date: Sun, 15 Dec 2024 01:44:27 +0000 Subject: [PATCH] -5 to -1 Signed-off-by: Eric Curtin --- examples/run/run.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/run/run.cpp b/examples/run/run.cpp index 1b95012278a6c7..eb22efd2540022 100644 --- a/examples/run/run.cpp +++ b/examples/run/run.cpp @@ -38,8 +38,8 @@ static std::string fmt(const char * fmt, ...) { const int size = vsnprintf(NULL, 0, fmt, ap); GGML_ASSERT(size >= 0 && size < INT_MAX); // NOLINT std::string buf; - buf.resize(size + 1); - const int size2 = vsnprintf(const_cast(buf.data()), buf.size(), fmt, ap2); + buf.resize(size); + const int size2 = vsnprintf(const_cast(buf.data()), buf.size() + 1, fmt, ap2); GGML_ASSERT(size2 == size); va_end(ap2); va_end(ap); @@ -370,7 +370,7 @@ class HttpClient { } static int calculate_progress_bar_width(const std::string & progress_prefix, const std::string & progress_suffix) { - int progress_bar_width = get_terminal_width() - progress_prefix.size() - progress_suffix.size() - 5; + int progress_bar_width = get_terminal_width() - progress_prefix.size() - progress_suffix.size() - 3; if (progress_bar_width < 1) { progress_bar_width = 1; }