diff --git a/src/modal.c b/src/modal.c index df6f2f4..5dcd970 100644 --- a/src/modal.c +++ b/src/modal.c @@ -22,15 +22,6 @@ copy(char *src, char *dst, int length) return dst; } -static int -slen(char *s) -{ - char *cap = s; - while(*cap++) - ; - return cap - s; -} - static char * walk(char *s) { @@ -272,8 +263,8 @@ static void remove_rule(Rule *r) { if(r < rules_ - 1) { - int distance = slen(r->a) + slen(r->b); char *memsrc = (r + 1)->a; + int distance = (r + 1)->a - r->a; copy(memsrc, r->a, dict_ - memsrc); while(r < rules_ - 1) { Rule *next = r + 1;