char **parse_style(char *s)
{
static char *parse[FUNLIMIT];
+ size_t parse_offsets[sizeof(parse) / sizeof(parse[0])];
static bool is_first = true;
size_t fun = 0;
bool in_parens = false;
return parse;
}
agxbputc(&ps_xb, '\0'); /* terminate previous */
- parse[fun++] = agxbnext(&ps_xb);
+ parse_offsets[fun++] = agxblen(&ps_xb);
}
agxbput_n(&ps_xb, c.start, c.size);
agxbputc(&ps_xb, '\0');
parse[0] = NULL;
return parse;
}
+
+ char *base = agxbuse(&ps_xb); // add final '\0' to buffer
+
+ // construct list of style strings
+ for (size_t i = 0; i < fun; ++i) {
+ parse[i] = base + parse_offsets[i];
+ }
parse[fun] = NULL;
- (void)agxbuse(&ps_xb); /* adds final '\0' to buffer */
+
return parse;
}
assert re.search(r"\bG2_", m.group("url")) is not None, \
"ID G2 was not applied to polygon fill url"
-@pytest.mark.xfail()
def test_2325():
"""
using more than 63 styles and/or more than 128 style bytes should not trigger