aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/rc
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2007-03-26 15:02:15 +0000
committerrsc <devnull@localhost>2007-03-26 15:02:15 +0000
commit40402738daf5ef541ffa358c17c5afc69a9d0c5e (patch)
tree62a5a39da37742058a98d798a94c511436c8a1e4 /src/cmd/rc
parent96f54e3fff8967000ed5bd5bd4501e47d194045d (diff)
downloadplan9port-40402738daf5ef541ffa358c17c5afc69a9d0c5e.tar.gz
plan9port-40402738daf5ef541ffa358c17c5afc69a9d0c5e.tar.bz2
plan9port-40402738daf5ef541ffa358c17c5afc69a9d0c5e.zip
more memory errors (valgrind)
Diffstat (limited to 'src/cmd/rc')
-rw-r--r--src/cmd/rc/code.c1
-rw-r--r--src/cmd/rc/io.c2
-rw-r--r--src/cmd/rc/subr.c1
3 files changed, 3 insertions, 1 deletions
diff --git a/src/cmd/rc/code.c b/src/cmd/rc/code.c
index 0ae90eeb..2c33e804 100644
--- a/src/cmd/rc/code.c
+++ b/src/cmd/rc/code.c
@@ -26,6 +26,7 @@ morecode(void)
if(codebuf==0)
panic("Can't realloc %d bytes in morecode!",
ncode*sizeof codebuf[0]);
+ memset(codebuf+ncode-100, 0, 100*sizeof codebuf[0]);
return 0;
}
diff --git a/src/cmd/rc/io.c b/src/cmd/rc/io.c
index 3ad1e2db..3f2695d6 100644
--- a/src/cmd/rc/io.c
+++ b/src/cmd/rc/io.c
@@ -37,7 +37,7 @@ pfmt(io *f, char *fmt, ...)
pwrd(f, va_arg(ap, char *));
break;
case 'r':
- errstr(err, sizeof err); pstr(f, err);
+ rerrstr(err, sizeof err); pstr(f, err);
break;
case 's':
pstr(f, va_arg(ap, char *));
diff --git a/src/cmd/rc/subr.c b/src/cmd/rc/subr.c
index a6b533b3..47f7439e 100644
--- a/src/cmd/rc/subr.c
+++ b/src/cmd/rc/subr.c
@@ -10,6 +10,7 @@ emalloc(long n)
if(p==0)
panic("Can't malloc %d bytes", n);
/* if(err){ pfmt(err, "malloc %d->%p\n", n, p); flush(err); } /**/
+ memset(p, 0, n);
return p;
}