diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1998-12-16 01:20:15 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1998-12-16 01:20:15 +0000 |
commit | 87da720d41fd0bdbdbe09f43cba36431b8362172 (patch) | |
tree | bb0ac35ca1dd83e310bf2ab33323554d6eff9d65 | |
parent | 67f9ab043fd9d49640691aee281b952a816c3e47 (diff) |
snprintf; dillon
-rw-r--r-- | usr.bin/wall/wall.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/usr.bin/wall/wall.c b/usr.bin/wall/wall.c index 1cc2e926942..e5b59f455b3 100644 --- a/usr.bin/wall/wall.c +++ b/usr.bin/wall/wall.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wall.c,v 1.9 1998/11/19 03:09:16 form Exp $ */ +/* $OpenBSD: wall.c,v 1.10 1998/12/16 01:20:14 deraadt Exp $ */ /* $NetBSD: wall.c,v 1.6 1994/11/17 07:17:58 jtc Exp $ */ /* @@ -44,7 +44,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)wall.c 8.2 (Berkeley) 11/16/93"; #endif -static char rcsid[] = "$OpenBSD: wall.c,v 1.9 1998/11/19 03:09:16 form Exp $"; +static char rcsid[] = "$OpenBSD: wall.c,v 1.10 1998/12/16 01:20:14 deraadt Exp $"; #endif /* not lint */ /* @@ -185,11 +185,10 @@ makemsg(fname) time_t now, time(); FILE *fp; int fd; - char *p, *whom, hostname[MAXHOSTNAMELEN], lbuf[100], tmpname[15]; + char *p, *whom, hostname[MAXHOSTNAMELEN], lbuf[100], tmpname[64]; char tmpbuf[5]; - (void)strcpy(tmpname, _PATH_TMP); - (void)strcat(tmpname, "wall.XXXXXX"); + snprintf(tmpname, sizeof(tmpname), "%s/wall.XXXXXX", _PATH_TMP); if (!(fd = mkstemp(tmpname)) || !(fp = fdopen(fd, "r+"))) errx(1, "can't open temporary file.\n"); (void)unlink(tmpname); |