diff --git a/usr.bin/banner/banner.c b/usr.bin/banner/banner.c index 3ab4ef6af773..57b5c6a69c85 100644 --- a/usr.bin/banner/banner.c +++ b/usr.bin/banner/banner.c @@ -1064,8 +1064,8 @@ main(int argc, char *argv[]) err(1, "malloc"); strcpy(message, *argv); while (*++argv) { - strcat(message, " "); - strcat(message, *argv); + strlcat(message, " ", j); + strlcat(message, *argv, j); } nchars = strlen(message); } else { diff --git a/usr.bin/fortune/strfile/strfile.c b/usr.bin/fortune/strfile/strfile.c index f0a8ed23ded4..ce28e274fd55 100644 --- a/usr.bin/fortune/strfile/strfile.c +++ b/usr.bin/fortune/strfile/strfile.c @@ -303,8 +303,8 @@ getargs(int argc, char **argv) usage(); } if (*Outfile == '\0') { - strcpy(Outfile, Infile); - strcat(Outfile, ".dat"); + strlcpy(Outfile, Infile, sizeof(Outfile)); + strlcat(Outfile, ".dat", sizeof(Outfile)); } } diff --git a/usr.bin/limits/limits.c b/usr.bin/limits/limits.c index 3dd7a7169e84..d500c333a759 100644 --- a/usr.bin/limits/limits.c +++ b/usr.bin/limits/limits.c @@ -561,7 +561,7 @@ print_limit(rlim_t limit, unsigned divisor, const char * inf, const char * pfx, char numbr[64]; if (limit == RLIM_INFINITY) - strcpy(numbr, inf); + strlcpy(numbr, inf, sizeof(numbr)); else sprintf(numbr, "%jd", (intmax_t)((limit + divisor/2) / divisor)); printf(pfx, which, numbr); diff --git a/usr.bin/rpcinfo/rpcinfo.c b/usr.bin/rpcinfo/rpcinfo.c index 3fdcfd1357ea..c528a145319b 100644 --- a/usr.bin/rpcinfo/rpcinfo.c +++ b/usr.bin/rpcinfo/rpcinfo.c @@ -856,9 +856,9 @@ rpcbdump(int dumptype, char *netid, int argc, char **argv) printf("%-10s", buf); buf[0] = '\0'; for (nl = rs->nlist; nl; nl = nl->next) { - strcat(buf, nl->netid); + strlcat(buf, nl->netid, sizeof(buf)); if (nl->next) - strcat(buf, ","); + strlcat(buf, ",", sizeof(buf)); } printf("%-32s", buf); rpc = getrpcbynumber(rs->prog);