From fdc9111c511bb75b17de92440a915f1b04175e22 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Thu, 28 Jul 2022 02:20:46 +0100 Subject: Fix length check in Metadata::in_scope --- slicer/slicer/metadata.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slicer/slicer/metadata.h b/slicer/slicer/metadata.h index 73e351c..6b209ae 100644 --- a/slicer/slicer/metadata.h +++ b/slicer/slicer/metadata.h @@ -97,7 +97,7 @@ namespace Slicer { static constexpr inline auto in_scope(std::string_view md, std::string_view scope) { - return ((md.length() == scope.length() || (md.length() >= scope.length() && md[scope.length()] == ':')) + return ((md.length() == scope.length() || (md.length() > scope.length() && md[scope.length()] == ':')) && md.compare(0, scope.length(), scope) == 0); } -- cgit v1.2.3