src: Enabling -Werror in debug mode and some style updates
Several important warnings are still getting suppressed, because of
CryptoPP library
Change-Id: I8fb3d938544ecc38c65529262504dc753124bafd
diff --git a/src/interest.cpp b/src/interest.cpp
index 229e0fb..a49ee1f 100644
--- a/src/interest.cpp
+++ b/src/interest.cpp
@@ -27,20 +27,24 @@
bool
Interest::matchesName(const Name &name) const
{
+ if (name.size() < m_name.size())
+ return false;
+
if (!m_name.isPrefixOf(name))
return false;
if (getMinSuffixComponents() >= 0 &&
// Add 1 for the implicit digest.
- !(name.size() + 1 - m_name.size() >= getMinSuffixComponents()))
+ !(name.size() + 1 - m_name.size() >= static_cast<size_t>(getMinSuffixComponents())))
return false;
if (getMaxSuffixComponents() >= 0 &&
// Add 1 for the implicit digest.
- !(name.size() + 1 - m_name.size() <= getMaxSuffixComponents()))
+ !(name.size() + 1 - m_name.size() <= static_cast<size_t>(getMaxSuffixComponents())))
return false;
- if (!getExclude().empty() && name.size() > m_name.size() &&
+ if (!getExclude().empty() &&
+ name.size() > m_name.size() &&
getExclude().isExcluded(name[m_name.size()]))
return false;