diff options
author | rsc <devnull@localhost> | 2007-02-11 18:42:11 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2007-02-11 18:42:11 +0000 |
commit | cc0e11e4172af055b3052798881fa03aeaefab44 (patch) | |
tree | 163de526654ef85fe10da0d135ac28c2551bc7fe /src | |
parent | 35368876ebfd1eb9f4e5eddec86cf0176d607386 (diff) | |
download | plan9port-cc0e11e4172af055b3052798881fa03aeaefab44.tar.gz plan9port-cc0e11e4172af055b3052798881fa03aeaefab44.tar.bz2 plan9port-cc0e11e4172af055b3052798881fa03aeaefab44.zip |
various memory errors in acme
Diffstat (limited to 'src')
-rw-r--r-- | src/cmd/acme/cols.c | 2 | ||||
-rw-r--r-- | src/cmd/acme/look.c | 10 |
2 files changed, 5 insertions, 7 deletions
diff --git a/src/cmd/acme/cols.c b/src/cmd/acme/cols.c index 8a74e34c..e2de4f4b 100644 --- a/src/cmd/acme/cols.c +++ b/src/cmd/acme/cols.c @@ -151,7 +151,7 @@ colclose(Column *c, Window *w, int dofree) windelete(w); winclose(w); } - memmove(c->w+i, c->w+i+1, (c->nw-i)*sizeof(Window*)); + memmove(c->w+i, c->w+i+1, (c->nw-i-1)*sizeof(Window*)); c->nw--; c->w = realloc(c->w, c->nw*sizeof(Window*)); if(c->nw == 0){ diff --git a/src/cmd/acme/look.c b/src/cmd/acme/look.c index e8f926f5..db699274 100644 --- a/src/cmd/acme/look.c +++ b/src/cmd/acme/look.c @@ -832,15 +832,13 @@ new(Text *et, Text *t, Text *argt, int flag1, int flag2, Rune *arg, int narg) f = runemalloc(nf); runemove(f, arg, nf); rs = dirname(et, f, nf); - f = rs.r; - nf = rs.nr; memset(&e, 0, sizeof e); - e.name = f; - e.nname = nf; - e.bname = runetobyte(f, nf); + e.name = rs.r; + e.nname = rs.nr; + e.bname = runetobyte(rs.r, rs.nr); e.jump = TRUE; openfile(et, &e, FALSE); - free(f); + free(e.name); free(e.bname); arg = skipbl(a, na, &narg); } |