From: Martin Walch Date: Thu, 3 Oct 2013 16:35:16 +0000 (+0200) Subject: kconfig: fix bug in search results string: use strlen(gstr->s), not gstr->len X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=173f491c6729177f94c389728f5c03386b52246f;p=carl9170fw.git kconfig: fix bug in search results string: use strlen(gstr->s), not gstr->len The struct gstr has a capacity that may differ from the actual string length. However, a string manipulation in the function search_conf made the assumption that it is the same, which led to messing up some search results, especially when the content of the gstr in use had not yet reached at least 63 chars. Signed-off-by: Martin Walch Acked-by: Wang YanQing Acked-by: Benjamin Poirier Reviewed-by: "Yann E. MORIN" Signed-off-by: "Yann E. MORIN" Signed-off-by: Christian Lamparter --- diff --git a/config/menu.c b/config/menu.c index 9e69f19..db1512a 100644 --- a/config/menu.c +++ b/config/menu.c @@ -584,7 +584,7 @@ static void get_prompt_str(struct gstr *r, struct property *prop, for (j = 4; --i >= 0; j += 2) { menu = submenu[i]; if (head && location && menu == location) - jump->offset = r->len - 1; + jump->offset = strlen(r->s); str_printf(r, "%*c-> %s", j, ' ', _(menu_get_prompt(menu))); if (menu->sym) {