diff --git a/SystemInformation.cxx b/SystemInformation.cxx
index 21fe135a96317bb06adb67decbd002ef417bf578..773abee36cdd91ee4bef42eff3b565b0efb5b75f 100644
--- a/SystemInformation.cxx
+++ b/SystemInformation.cxx
@@ -1331,7 +1331,7 @@ std::string SymbolProperties::GetFileName(const std::string& path) const
   if (!this->ReportPath) {
     size_t at = file.rfind("/");
     if (at != std::string::npos) {
-      file = file.substr(at + 1, std::string::npos);
+      file = file.substr(at + 1);
     }
   }
   return file;
diff --git a/SystemTools.cxx b/SystemTools.cxx
index c75dd0860eee9c6034bc3a0bb09312d1d3c9b234..c5bbd416a39e4ee92ad9e08b4cac7a77c85b00f9 100644
--- a/SystemTools.cxx
+++ b/SystemTools.cxx
@@ -1721,7 +1721,7 @@ std::string SystemTools::CropString(const std::string& s, size_t max_len)
   size_t middle = max_len / 2;
 
   n += s.substr(0, middle);
-  n += s.substr(s.size() - (max_len - middle), std::string::npos);
+  n += s.substr(s.size() - (max_len - middle));
 
   if (max_len > 2) {
     n[middle] = '.';