From a2858ec62b02df09bc97989c57df8c7aef3effe6 Mon Sep 17 00:00:00 2001 From: tastytea Date: Sun, 13 May 2018 08:19:50 +0200 Subject: [PATCH] Fixed the post-size calculation --- CMakeLists.txt | 2 +- src/parse.cpp | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2085cf2..9c4fa11 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required (VERSION 3.7) project (mastorss - VERSION 0.6.0 + VERSION 0.6.1 LANGUAGES CXX ) diff --git a/src/parse.cpp b/src/parse.cpp index 0836c36..0bd04f9 100644 --- a/src/parse.cpp +++ b/src/parse.cpp @@ -148,7 +148,9 @@ std::vector parse_website(const string &xml) str = std::regex_replace(str, std::regex("##"), "#"); if ((str.size() + link.size()) > static_cast(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 += " […]"; }