projects
/
platform
/
upstream
/
libxkbcommon.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6f8bb5e
)
atom: replace an avoidable strlen
author
Ran Benita
<ran@unusedvar.com>
Fri, 8 Nov 2019 22:20:45 +0000
(
00:20
+0200)
committer
Ran Benita
<ran@unusedvar.com>
Fri, 8 Nov 2019 22:20:45 +0000
(
00:20
+0200)
Signed-off-by: Ran Benita <ran@unusedvar.com>
src/atom.c
patch
|
blob
|
history
diff --git
a/src/atom.c
b/src/atom.c
index
fd05fb8
..
2b5b3ed
100644
(file)
--- 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) {