]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/contrib/string_view.h
StringView: rfind: pos should be end of substr, not start
[apt.git] / apt-pkg / contrib / string_view.h
index 3585da45a18440084aff32de1ed1c3bb6915c0f3..37a30a6dffcd32d225920ce1aaf6d724c6518374 100644 (file)
@@ -57,7 +57,7 @@ public:
 
     size_t rfind(int c, size_t pos=npos) const {
         if (pos != npos)
-            return substr(pos).rfind(c);
+            return substr(0, pos).rfind(c);
 
         const char *found = static_cast<const char*>(memrchr(data_, c, size_));