mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-15 07:34:33 +00:00
Guard for empty strings in CStrInCStrNoCase.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50823 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
6925f5074f
commit
fbd15899b3
@ -147,8 +147,8 @@ static inline bool StringsEqualNoCase(const std::string &LHS,
|
|||||||
/// NULL if 's1' cannot be found.
|
/// NULL if 's1' cannot be found.
|
||||||
static inline const char* CStrInCStrNoCase(const char *s1, const char *s2) {
|
static inline const char* CStrInCStrNoCase(const char *s1, const char *s2) {
|
||||||
|
|
||||||
// Are either strings NULL?
|
// Are either strings NULL or empty?
|
||||||
if (!s1 || !s2)
|
if (!s1 || !s2 || s1[0] == '\0' || s2[0] == '\0')
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
const char *I1=s1, *I2=s2;
|
const char *I1=s1, *I2=s2;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user