summaryrefslogtreecommitdiff
path: root/strings
diff options
context:
space:
mode:
Diffstat (limited to 'strings')
-rw-r--r--strings/apr_cstr.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/strings/apr_cstr.c b/strings/apr_cstr.c
index 1e0de5af4..6c27702e4 100644
--- a/strings/apr_cstr.c
+++ b/strings/apr_cstr.c
@@ -286,7 +286,8 @@ int apr_cstr_casecmp(const char *str1, const char *str2)
const int c1 = (int)(*((const unsigned char *)str1++));
const int c2 = (int)(*((const unsigned char *)str2++));
const int cmp = ucharmap[c1] - ucharmap[c2];
- if (cmp || !c1 || !c2)
+ /* Not necessary to test for !c2, this is caught by cmp */
+ if (cmp || !c1)
return cmp;
}
}
@@ -298,7 +299,8 @@ int apr_cstr_casecmpn(const char *str1, const char *str2, apr_size_t n)
const int c1 = (int)(*((const unsigned char *)str1++));
const int c2 = (int)(*((const unsigned char *)str2++));
const int cmp = ucharmap[c1] - ucharmap[c2];
- if (cmp || !c1 || !c2)
+ /* Not necessary to test for !c2, this is caught by cmp */
+ if (cmp || !c1)
return cmp;
}
return 0;