1
0
mirror of https://github.com/nerzhul/ownCloud-SMS-App.git synced 2025-06-19 13:56:28 +00:00

json::escape_string: if str is null return empty string

This commit is contained in:
Loic Blot 2017-10-30 08:38:20 +01:00
parent 8e15e18b09
commit d8855fd2c6
No known key found for this signature in database
GPG Key ID: EFAA458E8C153987

View File

@ -23,6 +23,10 @@ namespace json {
std::string escape_string(const char *str)
{
if (!str) {
return "";
}
std::string result;
// Create a sufficient buffer to escape all chars
result.reserve(strlen(str) * 2 + 3);