diff options
author | Minh Nguyễn <mxn@1ec5.org> | 2018-11-20 16:59:17 -0800 |
---|---|---|
committer | Minh Nguyễn <mxn@1ec5.org> | 2018-11-21 09:54:05 -0800 |
commit | 7d5be980e287c979119b06c73d071f2daaea1b3d (patch) | |
tree | 62b39bb3238250a85281c041507b23f91d309398 /src | |
parent | 594d2074a3849d141219c04cdde739f86e7256b3 (diff) | |
download | qtlocation-mapboxgl-7d5be980e287c979119b06c73d071f2daaea1b3d.tar.gz |
[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.
Diffstat (limited to 'src')
-rw-r--r-- | src/mbgl/storage/resource.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
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 { |