From a2a964b24cc9865022b34b52b4de497f99306311 Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Fri, 3 Jan 2020 18:03:14 +0100 Subject: [PATCH] src/utils: make strtolower return the string. --- src/utils.cpp | 3 ++- src/utils.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/utils.cpp b/src/utils.cpp index 12b4f29..a5abb4d 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -39,8 +39,9 @@ std::vector strsplit(const std::string& str, const std::string& del return r; } -void strtolower(std::string& str) { +std::string& strtolower(std::string& str) { std::transform(str.begin(), str.end(), str.begin(), [](unsigned char c){ return std::tolower(c); }); + return str; } std::string& ltrim(std::string& str) { diff --git a/src/utils.h b/src/utils.h index 0fc6518..6e53782 100644 --- a/src/utils.h +++ b/src/utils.h @@ -29,7 +29,7 @@ std::vector strsplit(const std::string& str, const std::string& delim); -void strtolower(std::string& str); +std::string& strtolower(std::string& str); std::string& rtrim(std::string& str); std::string& ltrim(std::string& str);