diff options
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); } |