Explorar el Código

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

Gbp-Dch: ignore
Julian Andres Klode hace 10 años
padre
commit
0e58689ae7
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  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_));