]> git.baikalelectronics.ru Git - uboot.git/commit
hashtable: Fix length calculation in hexport_r
authorZubair Lutfullah Kakakhel <zubair@resin.io>
Tue, 17 Jul 2018 18:25:38 +0000 (19:25 +0100)
committerTom Rini <trini@konsulko.com>
Tue, 24 Jul 2018 13:25:23 +0000 (09:25 -0400)
commit1d5569672646af1c2d4afd86a63ee1aeb651c882
tree4f23c54ccb165181f5516e63353e5235dee5be56
parent99291251d5c7254a671406c604a70d550b75a10a
hashtable: Fix length calculation in hexport_r

The length returned by hexport_r has a few redundant characters.
This appears as NULL characters at the end so seems harmless.

Remove the surplus counts in two places

totlen += strlen(ep->key) + 2;
I'm guessing the +2 here is for = and sep char. But there is another
totlen += 2; line that does that.

size = totletn + 1;
Doesn't make sense and isn't justified with any comment.

Signed-off-by: Zubair Lutfullah Kakakhel <zubair@resin.io>
lib/hashtable.c