=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/rwall/rwall.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- src/usr.bin/rwall/rwall.c 1996/09/16 02:26:14 1.3 +++ src/usr.bin/rwall/rwall.c 1998/12/16 01:29:37 1.4 @@ -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 @@ #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 @@ 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);