diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2016-05-03 19:22:22 -0400 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2016-05-03 19:22:22 -0400 |
commit | 98973d0eff84a160677b47b1cdeb8925fcf1b419 (patch) | |
tree | 09df7ef72b058565b7ca4af4a10add971f913895 /src/basic/strbuf.c | |
parent | 348dc14569eebfb7a1fbab59ba2f5b2228b5b25e (diff) | |
parent | c45606eb95a7171b0dc801e91d35034957ad5e9e (diff) |
Merge pull request #3185 from NetworkManager/lr/unhappy-trie
Fix incorrect string deduplication in udev
Diffstat (limited to 'src/basic/strbuf.c')
-rw-r--r-- | src/basic/strbuf.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/basic/strbuf.c b/src/basic/strbuf.c index 797f00cf71..4bef87d3c2 100644 --- a/src/basic/strbuf.c +++ b/src/basic/strbuf.c @@ -156,12 +156,13 @@ ssize_t strbuf_add_string(struct strbuf *str, const char *s, size_t len) { return off; } + c = s[len - 1 - depth]; + /* bsearch is not allowed on a NULL sequence */ if (node->children_count == 0) break; /* lookup child node */ - c = s[len - 1 - depth]; search.c = c; child = bsearch(&search, node->children, node->children_count, sizeof(struct strbuf_child_entry), |