atom: replace an avoidable strlen
Signed-off-by: Ran Benita <ran@unusedvar.com>master
parent
6f8bb5ee70
commit
8ea4a001d1
|
@ -148,7 +148,7 @@ find_atom_pointer(struct atom_table *table, const char *string, size_t len,
|
|||
else {
|
||||
/* Now start testing the strings. */
|
||||
const int cmp = strncmp(string, node->string, len);
|
||||
if (cmp < 0 || (cmp == 0 && len < strlen(node->string))) {
|
||||
if (cmp < 0 || (cmp == 0 && node->string[len] != '\0')) {
|
||||
atomp = &node->left;
|
||||
}
|
||||
else if (cmp > 0) {
|
||||
|
|
Loading…
Reference in New Issue