Fixed the post-size calculation

This commit is contained in:
tastytea 2018-05-13 08:19:50 +02:00
parent 136cea0a5d
commit a2858ec62b
Signed by: tastytea
GPG Key ID: 59346E0EA35C67E5
2 changed files with 4 additions and 2 deletions

View File

@ -1,6 +1,6 @@
cmake_minimum_required (VERSION 3.7)
project (mastorss
VERSION 0.6.0
VERSION 0.6.1
LANGUAGES CXX
)

View File

@ -148,7 +148,9 @@ std::vector<string> parse_website(const string &xml)
str = std::regex_replace(str, std::regex("##"), "#");
if ((str.size() + link.size()) > static_cast<std::uint16_t>(max_size - 15))
{
str.resize((max_size - link.size() - 15));
str.resize((max_size - link.size() -
config[profile]["append"].asString().length()
- 4));
str.resize(str.rfind(' ')); // Cut at word boundary
str += " […]";
}