From: Martin Walch Date: Wed, 15 Apr 2015 10:24:38 +0000 (+0100) Subject: kconfig: fix bug in search results string: use strlen(gstr->s), not gstr->len X-Git-Tag: firefly_0821_release~3680^2~12^2~3 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=b04591efd29ae924814d0559476ac421db86d9dd;p=firefly-linux-kernel-4.4.55.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" (cherry picked from commit 503c823048e81cc85c0e9d8c297cc70203e335e5) Signed-off-by: Jon Medhurst --- diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c index fd3f0180e08f..24ad40942586 100644 --- a/scripts/kconfig/menu.c +++ b/scripts/kconfig/menu.c @@ -564,7 +564,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) {