summaryrefslogtreecommitdiffabout
path: root/lib/sitecing_util.cc
Side-by-side diff
Diffstat (limited to 'lib/sitecing_util.cc') (more/less context) (ignore whitespace changes)
-rw-r--r--lib/sitecing_util.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/sitecing_util.cc b/lib/sitecing_util.cc
index 5466b28..f892a60 100644
--- a/lib/sitecing_util.cc
+++ b/lib/sitecing_util.cc
@@ -58,3 +58,3 @@ namespace sitecing {
string strip_prefix(const string& str,const string& prefix) {
- if(str.compare(0,prefix.length(),prefix))
+ if( (str.length()<prefix.length()) || str.compare(0,prefix.length(),prefix))
throw utility_no_prefix(CODEPOINT,"no such prefix");
@@ -64,3 +64,3 @@ namespace sitecing {
string strip_suffix(const string& str,const string& suffix) {
- if(str.compare(str.length()-suffix.length(),suffix.length(),suffix))
+ if( (str.length()<suffix.length()) || str.compare(str.length()-suffix.length(),suffix.length(),suffix))
throw utility_no_suffix(CODEPOINT,"no such suffix");