diff --git a/lib/checkbufferoverrun.cpp b/lib/checkbufferoverrun.cpp index b5e648b5a..c89738c70 100644 --- a/lib/checkbufferoverrun.cpp +++ b/lib/checkbufferoverrun.cpp @@ -195,7 +195,7 @@ void CheckBufferOverrun::pointerOutOfBoundsError(const Token *tok, const Token * // The severity is portability instead of error since this ub doesn't // cause bad behaviour on most implementations. people create out // of bounds pointers by intention. - const std::string expr(tok ? tok->expressionString() : std::string("")); + const std::string expr(tok ? tok->expressionString() : std::string()); std::string errmsg; if (index && !index->isNumber()) { errmsg = "Undefined behaviour, when '" + diff --git a/lib/settings.cpp b/lib/settings.cpp index 0199ab6d2..70ad8eba3 100644 --- a/lib/settings.cpp +++ b/lib/settings.cpp @@ -106,7 +106,7 @@ std::string Settings::addEnabled(const std::string &str) return std::string("cppcheck: there is no --enable parameter with the name '" + str + "'"); } - return std::string(""); + return std::string(); }