From dbb5a0599b1bfaf94e18a406fe908c8aaee9bb78 Mon Sep 17 00:00:00 2001 From: aristocratos Date: Sun, 6 Jun 2021 23:12:01 +0200 Subject: [PATCH] Fixed broken uresize() --- src/btop_tools.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/btop_tools.h b/src/btop_tools.h index 71a83d0..f937b0c 100644 --- a/src/btop_tools.h +++ b/src/btop_tools.h @@ -238,8 +238,8 @@ namespace Tools { if (len < 1) return ""; for (size_t x = 0, i = 0; i < str.size(); i++) { if ((static_cast(str.at(i)) & 0xC0) != 0x80) x++; - if (x == len) { - str.resize(i + 1); + if (x == len + 1) { + str.resize(i); str.shrink_to_fit(); break; }