From 8ea4a001d1979c99db28a280489a95906fe43048 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Sat, 9 Nov 2019 00:20:45 +0200 Subject: [PATCH] atom: replace an avoidable strlen Signed-off-by: Ran Benita --- src/atom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/atom.c b/src/atom.c index fd05fb8..2b5b3ed 100644 --- a/src/atom.c +++ b/src/atom.c @@ -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) { -- 2.34.1