From 0f5ad29b4e88ef3c736959a58a5b37c1fa3cc3a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20K=C3=A4fer?= Date: Thu, 18 Jun 2015 09:59:14 +0300 Subject: [PATCH] propertly initialize the name --- src/mbgl/map/sprite.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mbgl/map/sprite.cpp b/src/mbgl/map/sprite.cpp index d5af3e1d1d8..017cc61e195 100644 --- a/src/mbgl/map/sprite.cpp +++ b/src/mbgl/map/sprite.cpp @@ -128,7 +128,7 @@ void Sprite::parseJSON(const std::string& jsonURL) { emitSpriteLoadingFailed(message.str()); } else if (d.IsObject()) { for (rapidjson::Value::ConstMemberIterator itr = d.MemberBegin(); itr != d.MemberEnd(); ++itr) { - const std::string& name = itr->name.GetString(); + const std::string name = { itr->name.GetString(), itr->name.GetStringLength() }; const rapidjson::Value& value = itr->value; if (value.IsObject()) {