| Date: Mon, 26 Mar 2007 15:02:15 +0000
more memory errors (valgrind)
Diffstat:
M src/cmd/rc/code.c | 1 +
M src/cmd/rc/io.c | 2 +-
M src/cmd/rc/subr.c | 1 +
3 files changed, 3 insertions(+), 1 deletion(-)
--- |
| t@@ -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;
}
|
| t@@ -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 *)); |
| t@@ -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;
}
|