BLI: avoid passing nullptr to strncmp
This resulted in an ASAN warning.
This commit is contained in:
parent
efcf36f2e9
commit
698b05fc58
|
@ -610,6 +610,10 @@ constexpr bool operator==(StringRef a, StringRef b)
|
|||
if (a.size() != b.size()) {
|
||||
return false;
|
||||
}
|
||||
if (a.data() == b.data()) {
|
||||
/* This also avoids passing null to the call below, which would results in an ASAN warning. */
|
||||
return true;
|
||||
}
|
||||
return STREQLEN(a.data(), b.data(), (size_t)a.size());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue