From: Ingo Bürk Date: Mon, 25 Sep 2017 07:09:56 +0000 (+0200) Subject: Merge pull request #2985 from orestisf1993/next X-Git-Tag: 4.15~65 X-Git-Url: https://git.sur5r.net/?p=i3%2Fi3;a=commitdiff_plain;h=f4f3d649e2df0cec5035d4d943dfdfcef1d6296f;hp=89d6287110ad1d1556facf091943554e25fbcdd8 Merge pull request #2985 from orestisf1993/next Correct remaining string length for fill_rmlvo_from_root --- diff --git a/src/bindings.c b/src/bindings.c index 42a2b79b..c145b956 100644 --- a/src/bindings.c +++ b/src/bindings.c @@ -910,7 +910,6 @@ static int fill_rmlvo_from_root(struct xkb_rule_names *xkb_names) { int remaining = xcb_get_property_value_length(prop_reply); for (int i = 0; i < 5 && remaining > 0; i++) { const int len = strnlen(walk, remaining); - remaining -= len; switch (i) { case 0: sasprintf((char **)&(xkb_names->rules), "%.*s", len, walk); @@ -930,6 +929,7 @@ static int fill_rmlvo_from_root(struct xkb_rule_names *xkb_names) { } DLOG("component %d of _XKB_RULES_NAMES is \"%.*s\"\n", i, len, walk); walk += (len + 1); + remaining -= (len + 1); } free(atom_reply);