aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/rwall
diff options
context:
space:
mode:
authorMatthew Dillon <dillon@FreeBSD.org>1998-12-13 03:44:19 +0000
committerMatthew Dillon <dillon@FreeBSD.org>1998-12-13 03:44:19 +0000
commitde7c5467609ea96b4e662fe657b42244eccc62ca (patch)
tree526b8db3f181807bb6c52da22f650f3b00ce726b /usr.bin/rwall
parent98df703fe0e12bf73506bc7307beaf2b0cf18859 (diff)
Notes
Diffstat (limited to 'usr.bin/rwall')
-rw-r--r--usr.bin/rwall/rwall.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/usr.bin/rwall/rwall.c b/usr.bin/rwall/rwall.c
index 1c5d084f90fc..a39e478a8840 100644
--- a/usr.bin/rwall/rwall.c
+++ b/usr.bin/rwall/rwall.c
@@ -43,7 +43,7 @@ static const char copyright[] =
static char sccsid[] = "from: @(#)wall.c 5.14 (Berkeley) 3/2/91";
#endif
static const char rcsid[] =
- "$Id: rwall.c,v 1.5 1997/02/22 19:56:55 peter Exp $";
+ "$Id: rwall.c,v 1.6 1997/08/08 12:18:16 charnier Exp $";
#endif /* not lint */
/*
@@ -134,10 +134,9 @@ makemsg(fname)
time_t now, time();
FILE *fp;
int fd;
- char *whom, hostname[MAXHOSTNAMELEN], lbuf[100], tmpname[15];
+ char *whom, hostname[MAXHOSTNAMELEN], lbuf[256], tmpname[64];
- (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");
(void)unlink(tmpname);