Amazingly picky bug fixes from Valgrind.
This commit is contained in:
parent
230d62c475
commit
15680d56a6
9 changed files with 20 additions and 9 deletions
|
|
@ -115,9 +115,12 @@ static
|
|||
void
|
||||
chopbox(Frame *f, Frbox *b, int n) /* drop first n chars; no allocation done */
|
||||
{
|
||||
char *p;
|
||||
|
||||
if(b->nrune<0 || b->nrune<n)
|
||||
drawerror(f->display, "chopbox");
|
||||
strcpy((char*)b->ptr, (char*)runeindex(b->ptr, n));
|
||||
p = (char*)runeindex(b->ptr, n);
|
||||
memmove((char*)b->ptr, p, strlen(p)+1);
|
||||
b->nrune -= n;
|
||||
b->wid = stringwidth(f->font, (char *)b->ptr);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue