From 7d5be980e287c979119b06c73d071f2daaea1b3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguy=E1=BB=85n?= Date: Tue, 20 Nov 2018 16:59:17 -0800 Subject: [core] Fixed {prefix} evaluation This appears to have been an attempt to use the std::string fill constructor, but it ended up creating a one-character-long string and attempting to overwrite the null terminator. --- src/mbgl/storage/resource.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/mbgl') diff --git a/src/mbgl/storage/resource.cpp b/src/mbgl/storage/resource.cpp index aca53138ff..9ccedb6919 100644 --- a/src/mbgl/storage/resource.cpp +++ b/src/mbgl/storage/resource.cpp @@ -123,10 +123,10 @@ Resource Resource::tile(const std::string& urlTemplate, } else if (token == "bbox-epsg-3857") { return getTileBBox(x, y, z); } else if (token == "prefix") { - std::string prefix{ 2 }; - prefix[0] = "0123456789abcdef"[x % 16]; - prefix[1] = "0123456789abcdef"[y % 16]; - return prefix; + return {{ + "0123456789abcdef"[x % 16], + "0123456789abcdef"[y % 16], + }}; } else if (token == "ratio") { return std::string(pixelRatio > 1.0 ? "@2x" : ""); } else { -- cgit v1.2.1