Ver código fonte

StringView: rfind: pos should be end of substr, not start

Gbp-Dch: ignore
Julian Andres Klode 10 anos atrás
pai
commit
0e58689ae7
1 arquivos alterados com 1 adições e 1 exclusões
  1. 1 1
      apt-pkg/contrib/string_view.h

+ 1 - 1
apt-pkg/contrib/string_view.h

@@ -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_));