summaryrefslogtreecommitdiff
path: root/usr.bin/rwall/rwall.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1998-12-16 01:29:38 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1998-12-16 01:29:38 +0000
commit8ab7a7cab00ada3acf58040bd68974e3456dd83a (patch)
tree252a6ea3fb1a04c2a43c7560cb3c2903e7dd0f41 /usr.bin/rwall/rwall.c
parentc9b46c46d8079ffe7f5c323654a5673415ef764f (diff)
snprintf; dillon
Diffstat (limited to 'usr.bin/rwall/rwall.c')
-rw-r--r--usr.bin/rwall/rwall.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/usr.bin/rwall/rwall.c b/usr.bin/rwall/rwall.c
index c31cfdb5376..26ef930cd75 100644
--- a/usr.bin/rwall/rwall.c
+++ b/usr.bin/rwall/rwall.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rwall.c,v 1.3 1996/09/16 02:26:14 deraadt Exp $ */
+/* $OpenBSD: rwall.c,v 1.4 1998/12/16 01:29:37 deraadt Exp $ */
/*
* Copyright (c) 1993 Christopher G. Demetriou
@@ -42,7 +42,7 @@ char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)wall.c 5.14 (Berkeley) 3/2/91";*/
-static char rcsid[] = "$OpenBSD: rwall.c,v 1.3 1996/09/16 02:26:14 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: rwall.c,v 1.4 1998/12/16 01:29:37 deraadt Exp $";
#endif /* not lint */
/*
@@ -124,10 +124,9 @@ makemsg(fname)
time_t now;
FILE *fp;
int fd;
- char *whom, hostname[MAXHOSTNAMELEN], lbuf[100], tmpname[32];
+ char *whom, hostname[MAXHOSTNAMELEN], lbuf[100], 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+"))) {
(void)fprintf(stderr, "wall: can't open temporary file.\n");
exit(1);