diff options
author | Peter Valchev <pvalchev@cvs.openbsd.org> | 2003-04-06 06:12:02 +0000 |
---|---|---|
committer | Peter Valchev <pvalchev@cvs.openbsd.org> | 2003-04-06 06:12:02 +0000 |
commit | b4b554091d09542655ec20a4662ffdc741e847e3 (patch) | |
tree | ca19f3175c9cfc8dd7580d247f9aef8007d9a5af /usr.bin/awk/run.c | |
parent | f55330f67f5d8f384f364f1c35cbf5bf1e25b367 (diff) |
more string business; millert ok and suggestion for strdup
Diffstat (limited to 'usr.bin/awk/run.c')
-rw-r--r-- | usr.bin/awk/run.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/usr.bin/awk/run.c b/usr.bin/awk/run.c index abbf3d3717b..a2528d662c5 100644 --- a/usr.bin/awk/run.c +++ b/usr.bin/awk/run.c @@ -1,4 +1,4 @@ -/* $OpenBSD: run.c,v 1.19 2003/04/04 00:42:34 deraadt Exp $ */ +/* $OpenBSD: run.c,v 1.20 2003/04/06 06:12:01 pvalchev Exp $ */ /**************************************************************** Copyright (C) Lucent Technologies 1997 All Rights Reserved @@ -458,9 +458,9 @@ Cell *array(Node **a, int n) /* a[0] is symtab, a[1] is list of subscripts */ s = getsval(y); if (!adjbuf(&buf, &bufsz, strlen(buf)+strlen(s)+nsub+1, recsize, 0, 0)) FATAL("out of memory for %s[%s...]", x->nval, buf); - strcat(buf, s); + strlcat(buf, s, bufsz); if (np->nnext) - strcat(buf, *SUBSEP); + strlcat(buf, *SUBSEP, bufsz); tempfree(y); } if (!isarr(x)) { @@ -505,9 +505,9 @@ Cell *awkdelete(Node **a, int n) /* a[0] is symtab, a[1] is list of subscripts * s = getsval(y); if (!adjbuf(&buf, &bufsz, strlen(buf)+strlen(s)+nsub+1, recsize, 0, 0)) FATAL("out of memory deleting %s[%s...]", x->nval, buf); - strcat(buf, s); + strlcat(buf, s, bufsz); if (np->nnext) - strcat(buf, *SUBSEP); + strlcat(buf, *SUBSEP, bufsz); tempfree(y); } freeelem(x, buf); @@ -544,10 +544,10 @@ Cell *intest(Node **a, int n) /* a[0] is index (list), a[1] is symtab */ s = getsval(x); if (!adjbuf(&buf, &bufsz, strlen(buf)+strlen(s)+nsub+1, recsize, 0, 0)) FATAL("out of memory deleting %s[%s...]", x->nval, buf); - strcat(buf, s); + strlcat(buf, s, bufsz); tempfree(x); if (p->nnext) - strcat(buf, *SUBSEP); + strlcat(buf, *SUBSEP, bufsz); } k = lookup(buf, (Array *) ap->sval); tempfree(ap); |