atom: replace an avoidable strlen

Signed-off-by: Ran Benita <ran@unusedvar.com>
master
Ran Benita 2019-11-09 00:20:45 +02:00
parent 6f8bb5ee70
commit 8ea4a001d1
1 changed files with 1 additions and 1 deletions

View File

@ -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) {