diff options
author | Ted Kremenek <kremenek@apple.com> | 2008-05-07 18:49:31 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2008-05-07 18:49:31 +0000 |
commit | 6f79f7e32a6025a5cb2fc7b168e33ed4601fca53 (patch) | |
tree | 4983962de0304a99b433fad73619a76611ffe99c /include/llvm/ADT/StringExtras.h | |
parent | bbc2799a7fa5818c4eb9d9ad8de2ac752d767a53 (diff) | |
download | external_llvm-6f79f7e32a6025a5cb2fc7b168e33ed4601fca53.zip external_llvm-6f79f7e32a6025a5cb2fc7b168e33ed4601fca53.tar.gz external_llvm-6f79f7e32a6025a5cb2fc7b168e33ed4601fca53.tar.bz2 |
Guard for empty strings in CStrInCStrNoCase.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50823 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/ADT/StringExtras.h')
-rw-r--r-- | include/llvm/ADT/StringExtras.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/llvm/ADT/StringExtras.h b/include/llvm/ADT/StringExtras.h index 9a3e1b5..e3b3c87 100644 --- a/include/llvm/ADT/StringExtras.h +++ b/include/llvm/ADT/StringExtras.h @@ -147,8 +147,8 @@ static inline bool StringsEqualNoCase(const std::string &LHS, /// NULL if 's1' cannot be found. static inline const char* CStrInCStrNoCase(const char *s1, const char *s2) { - // Are either strings NULL? - if (!s1 || !s2) + // Are either strings NULL or empty? + if (!s1 || !s2 || s1[0] == '\0' || s2[0] == '\0') return 0; const char *I1=s1, *I2=s2; |