From 15680d56a6c6e15921d958aa6006825c2cd20bf8 Mon Sep 17 00:00:00 2001 From: rsc Date: Fri, 5 Mar 2004 05:53:11 +0000 Subject: Amazingly picky bug fixes from Valgrind. --- src/libframe/frbox.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/libframe') diff --git a/src/libframe/frbox.c b/src/libframe/frbox.c index d2593011..beb37c16 100644 --- a/src/libframe/frbox.c +++ b/src/libframe/frbox.c @@ -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->nrunedisplay, "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); } -- cgit v1.2.3