diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2002-05-29 19:23:35 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2002-05-29 19:23:35 +0000 |
commit | 33d1e7e11841c4b322024db48896307aebfdf064 (patch) | |
tree | d8a369effce880462c7dd398b053e684a7902084 /sbin | |
parent | 64a56d7da49c94d367f89fc8570982d86ff15b46 (diff) |
more strlcat
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/restore/restore.c | 12 | ||||
-rw-r--r-- | sbin/restore/utilities.c | 16 | ||||
-rw-r--r-- | sbin/ttyflags/ttyflags.c | 32 |
3 files changed, 30 insertions, 30 deletions
diff --git a/sbin/restore/restore.c b/sbin/restore/restore.c index a05abf8404d..28afa13f237 100644 --- a/sbin/restore/restore.c +++ b/sbin/restore/restore.c @@ -1,4 +1,4 @@ -/* $OpenBSD: restore.c,v 1.7 2002/02/16 21:27:37 millert Exp $ */ +/* $OpenBSD: restore.c,v 1.8 2002/05/29 19:23:34 deraadt Exp $ */ /* $NetBSD: restore.c,v 1.9 1997/06/18 07:10:16 lukem Exp $ */ /* @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)restore.c 8.3 (Berkeley) 9/13/94"; #else -static char rcsid[] = "$OpenBSD: restore.c,v 1.7 2002/02/16 21:27:37 millert Exp $"; +static char rcsid[] = "$OpenBSD: restore.c,v 1.8 2002/05/29 19:23:34 deraadt Exp $"; #endif #endif /* not lint */ @@ -515,13 +515,13 @@ keyval(key) (void)strcpy(keybuf, "|NIL"); keybuf[0] = '\0'; if (key & ONTAPE) - (void)strcat(keybuf, "|ONTAPE"); + (void)strlcat(keybuf, "|ONTAPE", sizeof keybuf); if (key & INOFND) - (void)strcat(keybuf, "|INOFND"); + (void)strlcat(keybuf, "|INOFND", sizeof keybuf); if (key & NAMEFND) - (void)strcat(keybuf, "|NAMEFND"); + (void)strlcat(keybuf, "|NAMEFND", sizeof keybuf); if (key & MODECHG) - (void)strcat(keybuf, "|MODECHG"); + (void)strlcat(keybuf, "|MODECHG", sizeof keybuf); return (&keybuf[1]); } diff --git a/sbin/restore/utilities.c b/sbin/restore/utilities.c index eb7100caedf..273e4ce1ad4 100644 --- a/sbin/restore/utilities.c +++ b/sbin/restore/utilities.c @@ -1,4 +1,4 @@ -/* $OpenBSD: utilities.c,v 1.9 2002/02/23 21:18:11 deraadt Exp $ */ +/* $OpenBSD: utilities.c,v 1.10 2002/05/29 19:23:34 deraadt Exp $ */ /* $NetBSD: utilities.c,v 1.11 1997/03/19 08:42:56 lukem Exp $ */ /* @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)utilities.c 8.4 (Berkeley) 10/18/94"; #else -static char rcsid[] = "$OpenBSD: utilities.c,v 1.9 2002/02/23 21:18:11 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: utilities.c,v 1.10 2002/05/29 19:23:34 deraadt Exp $"; #endif #endif /* not lint */ @@ -348,17 +348,17 @@ flagvalues(ep) (void)strcpy(flagbuf, "|NIL"); flagbuf[0] = '\0'; if (ep->e_flags & REMOVED) - (void)strcat(flagbuf, "|REMOVED"); + (void)strlcat(flagbuf, "|REMOVED", sizeof flagbuf); if (ep->e_flags & TMPNAME) - (void)strcat(flagbuf, "|TMPNAME"); + (void)strlcat(flagbuf, "|TMPNAME", sizeof flagbuf); if (ep->e_flags & EXTRACT) - (void)strcat(flagbuf, "|EXTRACT"); + (void)strlcat(flagbuf, "|EXTRACT", sizeof flagbuf); if (ep->e_flags & NEW) - (void)strcat(flagbuf, "|NEW"); + (void)strlcat(flagbuf, "|NEW", sizeof flagbuf); if (ep->e_flags & KEEP) - (void)strcat(flagbuf, "|KEEP"); + (void)strlcat(flagbuf, "|KEEP", sizeof flagbuf); if (ep->e_flags & EXISTED) - (void)strcat(flagbuf, "|EXISTED"); + (void)strlcat(flagbuf, "|EXISTED", sizeof flagbuf); return (&flagbuf[1]); } diff --git a/sbin/ttyflags/ttyflags.c b/sbin/ttyflags/ttyflags.c index 138100472c4..f30574fec65 100644 --- a/sbin/ttyflags/ttyflags.c +++ b/sbin/ttyflags/ttyflags.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ttyflags.c,v 1.8 2002/02/16 21:27:38 millert Exp $ */ +/* $OpenBSD: ttyflags.c,v 1.9 2002/05/29 19:23:34 deraadt Exp $ */ /* $NetBSD: ttyflags.c,v 1.8 1996/04/09 05:20:30 cgd Exp $ */ /* @@ -39,7 +39,7 @@ char copyright[] = #endif /* not lint */ #ifndef lint -static char rcsid[] = "$OpenBSD: ttyflags.c,v 1.8 2002/02/16 21:27:38 millert Exp $"; +static char rcsid[] = "$OpenBSD: ttyflags.c,v 1.9 2002/05/29 19:23:34 deraadt Exp $"; #endif /* not lint */ #include <sys/types.h> @@ -183,26 +183,26 @@ ttyflags(tep, print) /* Convert ttyent.h flags into ioctl flags. */ if (st & TTY_LOCAL) { flags |= TIOCFLAG_CLOCAL; - (void)strcat(strflags, "local"); + (void)strlcat(strflags, "local", sizeof strflags); sep++; } if (st & TTY_RTSCTS) { flags |= TIOCFLAG_CRTSCTS; if (sep++) - (void)strcat(strflags, "|"); - (void)strcat(strflags, "rtscts"); + (void)strlcat(strflags, "|", sizeof strflags); + (void)strlcat(strflags, "rtscts", sizeof strflags); } if (st & TTY_SOFTCAR) { flags |= TIOCFLAG_SOFTCAR; if (sep++) - (void)strcat(strflags, "|"); - (void)strcat(strflags, "softcar"); + (void)strlcat(strflags, "|", sizeof strflags); + (void)strlcat(strflags, "softcar", sizeof strflags); } if (st & TTY_MDMBUF) { flags |= TIOCFLAG_MDMBUF; if (sep++) - (void)strcat(strflags, "|"); - (void)strcat(strflags, "mdmbuf"); + (void)strlcat(strflags, "|", sizeof strflags); + (void)strlcat(strflags, "mdmbuf", sizeof strflags); } if (vflag) printf("%s setting flags to: %s\n", path, strflags); @@ -233,23 +233,23 @@ ttyflags(tep, print) rval = (errno != ENOTTY); } if (flags & TIOCFLAG_CLOCAL) { - (void)strcat(strflags, "local"); + (void)strlcat(strflags, "local", sizeof strflags); sep++; } if (flags & TIOCFLAG_CRTSCTS) { if (sep++) - (void)strcat(strflags, "|"); - (void)strcat(strflags, "rtscts"); + (void)strlcat(strflags, "|", sizeof strflags); + (void)strlcat(strflags, "rtscts", sizeof strflags); } if (flags & TIOCFLAG_SOFTCAR) { if (sep++) - (void)strcat(strflags, "|"); - (void)strcat(strflags, "softcar"); + (void)strlcat(strflags, "|", sizeof strflags); + (void)strlcat(strflags, "softcar", sizeof strflags); } if (flags & TIOCFLAG_MDMBUF) { if (sep++) - (void)strcat(strflags, "|"); - (void)strcat(strflags, "mdmbuf"); + (void)strlcat(strflags, "|", sizeof strflags); + (void)strlcat(strflags, "mdmbuf", sizeof strflags); } printf("%s flags are: %s\n", path, strflags); } |