Index: main.c =================================================================== RCS file: /home/imp/FreeBSD/CVS/src/usr.sbin/config/main.c,v retrieving revision 1.37.2.2 diff -u -r1.37.2.2 main.c --- main.c 2000/11/21 20:03:38 1.37.2.2 +++ main.c 2001/06/26 19:35:18 @@ -97,10 +97,12 @@ while ((ch = getopt(argc, argv, "d:gprn")) != -1) switch (ch) { case 'd': - if (*destdir == '\0') - strlcpy(destdir, optarg, sizeof(destdir)); - else + if (*destdir == '\0') { + strncpy(destdir, optarg, sizeof(destdir)); + destdir[ sizeof(destdir) - 1] = '\0'; + } else { errx(2, "directory already set"); + } break; case 'g': debugging++; @@ -135,8 +137,7 @@ destdir[--len] = '\0'; get_srcdir(); } else { - strlcpy(destdir, CDIR, sizeof(destdir)); - strlcat(destdir, PREFIX, sizeof(destdir)); + snprintf(destdir, sizeof(destdir), "%s%s", CDIR, PREFIX); } p = path((char *)NULL); Index: mkoptions.c =================================================================== RCS file: /home/imp/FreeBSD/CVS/src/usr.sbin/config/mkoptions.c,v retrieving revision 1.17.2.2 diff -u -r1.17.2.2 mkoptions.c --- mkoptions.c 2000/11/21 20:03:38 1.17.2.2 +++ mkoptions.c 2001/06/26 19:38:04 @@ -281,16 +281,19 @@ struct opt_list *po; /* "cannot happen"? the otab list should be complete.. */ - (void) strlcpy(nbuf, "options.h", sizeof(nbuf)); + (void)strncpy(nbuf, "options.h", sizeof(nbuf)); + nbuf[sizeof(nbuf) - 1] = '\0'; for (po = otab ; po != 0; po = po->o_next) { if (eq(po->o_name, name)) { - strlcpy(nbuf, po->o_file, sizeof(nbuf)); + strncpy(nbuf, po->o_file, sizeof(nbuf)); + nbuf[sizeof(nbuf) - 1] = '\0'; break; } } - (void) strlcpy(hbuf, path(nbuf), sizeof(hbuf)); + (void)strncpy(hbuf, path(nbuf), sizeof(hbuf)); + hbuf[sizeof(hbuf) - 1] = '\0'; return (hbuf); }