From e893a4066f2006c75f81691a3e29a9a53b353dde Mon Sep 17 00:00:00 2001 From: tastytea Date: Sun, 25 Nov 2018 10:58:55 +0100 Subject: [PATCH] Added support for size (not just s) Fixes #3 --- CMakeLists.txt | 2 +- src/libravatarserv.cpp | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 16add35..0a08c59 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required (VERSION 3.2) project(libravatarserv - VERSION 0.2.4 + VERSION 0.2.5 LANGUAGES CXX ) diff --git a/src/libravatarserv.cpp b/src/libravatarserv.cpp index f87f69e..c016cff 100644 --- a/src/libravatarserv.cpp +++ b/src/libravatarserv.cpp @@ -67,6 +67,11 @@ int main() { size = static_cast(std::stoul(digest.substr(pos_size + 2))); } + pos_size = digest.find("size=", pos_digest); + if (pos_size != std::string::npos) + { + size = static_cast(std::stoul(digest.substr(pos_size + 5))); + } digest = digest.substr(0, pos_digest); }