[U-Boot] [PATCH] hashtable: fix length calculation in hexport_r

2018-12-14 Thread AKASHI Takahiro
The commit below incorrectly fixed hexport_r(); > size = totlen + 1; One extra byte is necessary to NULL-terminate a whole buffer, "resp." Fixes: f1b20acb4a03 ("hashtable: Fix length calculation in hexport_r") Signed-off-by: AKASHI Takahiro --- lib/hashtable.c | 2 +- 1 file changed, 1 ins

[U-Boot] [PATCH] hashtable: Fix length calculation in hexport_r

2018-07-17 Thread Zubair Lutfullah Kakakhel
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 th