diff options
author | rsc <devnull@localhost> | 2004-03-05 05:53:11 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2004-03-05 05:53:11 +0000 |
commit | 15680d56a6c6e15921d958aa6006825c2cd20bf8 (patch) | |
tree | 84abb4cb8d761fb49d688b3eebcf17e47f05372a /src/libframe | |
parent | 230d62c4756ece47951e96a7cb1b5b72cf6a3844 (diff) | |
download | plan9port-15680d56a6c6e15921d958aa6006825c2cd20bf8.tar.gz plan9port-15680d56a6c6e15921d958aa6006825c2cd20bf8.tar.bz2 plan9port-15680d56a6c6e15921d958aa6006825c2cd20bf8.zip |
Amazingly picky bug fixes from Valgrind.
Diffstat (limited to 'src/libframe')
-rw-r--r-- | src/libframe/frbox.c | 5 |
1 files changed, 4 insertions, 1 deletions
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->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); } |