acme: fix off by one in colclose(), make dellist() code consistent

This commit is contained in:
cinap_lenrek 2020-01-19 18:43:51 +01:00
parent 561346d07f
commit a898d31f76
2 changed files with 2 additions and 2 deletions

View file

@ -131,8 +131,8 @@ colclose(Column *c, Window *w, int dofree)
windelete(w);
winclose(w);
}
memmove(c->w+i, c->w+i+1, (c->nw-i)*sizeof(Window*));
c->nw--;
memmove(c->w+i, c->w+i+1, (c->nw-i)*sizeof(Window*));
c->w = realloc(c->w, c->nw*sizeof(Window*));
if(c->nw == 0){
draw(screen, r, display->white, nil, ZP);

View file

@ -267,8 +267,8 @@ growlist(List *l)
void
dellist(List *l, int i)
{
memmove(&l->ptr[i], &l->ptr[i+1], (l->nused-(i+1))*sizeof(void*));
l->nused--;
memmove(&l->ptr[i], &l->ptr[i+1], (l->nused-i)*sizeof(void*));
}
/*