From: anon Date: Fri, 25 Aug 2023 19:17:00 +0000 (+0200) Subject: Merge branch 'master' of https://git.lain.church/emil/hl X-Git-Url: https://git.xolatile.top/?a=commitdiff_plain;h=516bc8656b62b76b0b5dc7458c935debdb17bd3f;p=public-libhl.git Merge branch 'master' of https://git.lain.church/emil/hl --- 516bc8656b62b76b0b5dc7458c935debdb17bd3f diff --cc source/hl.h index 7b00714,7c08fe1..a46080b --- a/source/hl.h +++ b/source/hl.h @@@ -191,13 -196,13 +195,13 @@@ int token_fits(const token_t * cons void render_string(const char * const string, const char * const mode) { for (const char * s = string; *s != '\00';) { - int f = 0; + int f = 0; size_t token_index = 0; - int offset; + int offset = 0; for (; token_index < token_table.element_count; token_index++) { - token_t * t = vector_get(&token_table, - token_index); + token_t * t = *(token_t**)vector_get(&token_table, + token_index); f = token_fits(t, string, s - string, &offset); if (f) { break; diff --cc source/regex.c index 36e6a42,9bba039..39d5c95 --- a/source/regex.c +++ b/source/regex.c @@@ -359,8 -353,8 +359,8 @@@ void HOOK_ALL(int from regex_t * regex_compile(const char * const pattern) { regex_t * regex = (regex_t *)malloc(sizeof(regex_t)); regex->str = strdup(pattern); - vector_init(®ex->delta_table, sizeof(delta_t), 0UL); - vector_init(®ex->catch_table, sizeof(offshoot_t), 0UL); - vector_init(regex.delta_table, sizeof(delta_t), 0); - vector_init(regex.catch_table, sizeof(offshoot_t), 0); ++ vector_init(®ex->delta_table, sizeof(delta_t*), 0UL); ++ vector_init(®ex->catch_table, sizeof(offshoot_t*), 0UL); int state = 0;