diff options
author | Petter Rodhelind <petter.rodhelind@gmail.com> | 2017-04-20 20:18:35 +0200 |
---|---|---|
committer | Petter Rodhelind <petter.rodhelind@gmail.com> | 2017-04-20 20:18:35 +0200 |
commit | 1c4e181b65ebaeb8d3f6c0aef6cd3d9b668e014b (patch) | |
tree | 99dee4850071c258a7bf04776687d0e437c2a90c /src | |
parent | 0ee751f8135e07175fa15ef11225a1d5ccaa5956 (diff) | |
parent | 94b38bdb722052838eb0d940c05995b870db4ea0 (diff) | |
download | plan9port-1c4e181b65ebaeb8d3f6c0aef6cd3d9b668e014b.tar.gz plan9port-1c4e181b65ebaeb8d3f6c0aef6cd3d9b668e014b.tar.bz2 plan9port-1c4e181b65ebaeb8d3f6c0aef6cd3d9b668e014b.zip |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'src')
-rw-r--r-- | src/cmd/9term/win.c | 2 | ||||
-rw-r--r-- | src/libdraw/font.c | 4 |
2 files changed, 2 insertions, 4 deletions
diff --git a/src/cmd/9term/win.c b/src/cmd/9term/win.c index 032f9ded..017d546b 100644 --- a/src/cmd/9term/win.c +++ b/src/cmd/9term/win.c @@ -634,7 +634,7 @@ label(char *sr, int n) el = r+1; if(el-sr > sizeof wdir - strlen(name) - 20) - sr = el - sizeof wdir - strlen(name) - 20; + sr = el - (sizeof wdir - strlen(name) - 20); for(sl=el-3; sl>=sr; sl--) if(sl[0]=='\033' && sl[1]==']' && sl[2]==';') break; diff --git a/src/libdraw/font.c b/src/libdraw/font.c index 8370606e..13bcd267 100644 --- a/src/libdraw/font.c +++ b/src/libdraw/font.c @@ -222,16 +222,14 @@ loadchar(Font *f, Rune r, Cacheinfo *c, int h, int noflush, char **subfontname) subf->age = 0; }else{ /* too recent; grow instead */ of = f->subf; - f->subf = malloc((f->nsubf+DSUBF)*sizeof *subf); + f->subf = realloc(of, (f->nsubf+DSUBF)*sizeof *subf); if(f->subf == nil){ f->subf = of; goto Toss; } - memmove(f->subf, of, (f->nsubf+DSUBF)*sizeof *subf); memset(f->subf+f->nsubf, 0, DSUBF*sizeof *subf); subf = &f->subf[f->nsubf]; f->nsubf += DSUBF; - free(of); } } subf->age = 0; |