diff options
-rw-r--r-- | bin/csh/lex.c | 10 | ||||
-rw-r--r-- | bin/csh/proc.c | 8 |
2 files changed, 10 insertions, 8 deletions
diff --git a/bin/csh/lex.c b/bin/csh/lex.c index a87160b5f7a..0a2df425b0d 100644 --- a/bin/csh/lex.c +++ b/bin/csh/lex.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lex.c,v 1.8 2003/01/08 06:54:16 deraadt Exp $ */ +/* $OpenBSD: lex.c,v 1.9 2003/04/07 22:45:59 tedu Exp $ */ /* $NetBSD: lex.c,v 1.9 1995/09/27 00:38:46 jtc Exp $ */ /*- @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)lex.c 8.1 (Berkeley) 5/31/93"; #else -static char rcsid[] = "$OpenBSD: lex.c,v 1.8 2003/01/08 06:54:16 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: lex.c,v 1.9 2003/04/07 22:45:59 tedu Exp $"; #endif #endif /* not lint */ @@ -973,7 +973,8 @@ subword(cp, type, adid) return (STRNULL); } *wp = 0; - (void) Strcat(wp, lhsb); + (void)Strlcat(wp, lhsb, + sizeof(wbuf)/sizeof(Char) - (wp - wbuf)); wp = Strend(wp); continue; } @@ -984,7 +985,8 @@ subword(cp, type, adid) return (STRNULL); } *wp = 0; - (void) Strcat(wp, mp); + (void)Strlcat(wp, mp, + sizeof(wbuf)/sizeof(Char) - (wp - wbuf)); *adid = 1; return (Strsave(wbuf)); } diff --git a/bin/csh/proc.c b/bin/csh/proc.c index 4c69a71bc10..0342b70b25f 100644 --- a/bin/csh/proc.c +++ b/bin/csh/proc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: proc.c,v 1.16 2003/01/08 06:54:16 deraadt Exp $ */ +/* $OpenBSD: proc.c,v 1.17 2003/04/07 22:45:59 tedu Exp $ */ /* $NetBSD: proc.c,v 1.9 1995/04/29 23:21:33 mycroft Exp $ */ /*- @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)proc.c 8.1 (Berkeley) 5/31/93"; #else -static char rcsid[] = "$OpenBSD: proc.c,v 1.16 2003/01/08 06:54:16 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: proc.c,v 1.17 2003/04/07 22:45:59 tedu Exp $"; #endif #endif /* not lint */ @@ -600,12 +600,12 @@ pads(cp) if (cmdlen >= PMAXLEN) return; if (cmdlen + i >= PMAXLEN) { - (void) Strlcpy(cmdp, STRsp3dots, PMAXLEN - i); /* XXX? */ + (void) Strlcpy(cmdp, STRsp3dots, PMAXLEN - cmdlen); cmdlen = PMAXLEN; cmdp += 4; return; } - (void) Strlcpy(cmdp, cp, PMAXLEN); + (void) Strlcpy(cmdp, cp, PMAXLEN - cmdlen); cmdp += i; cmdlen += i; } |