=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/from/from.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- src/usr.bin/from/from.c 1998/07/10 15:51:20 1.4 +++ src/usr.bin/from/from.c 1999/08/26 14:17:20 1.5 @@ -1,4 +1,4 @@ -/* $OpenBSD: from.c,v 1.4 1998/07/10 15:51:20 mickey Exp $ */ +/* $OpenBSD: from.c,v 1.5 1999/08/26 14:17:20 aaron Exp $ */ /* $NetBSD: from.c,v 1.6 1995/09/01 01:39:10 jtc Exp $ */ /* @@ -44,7 +44,7 @@ #if 0 static char sccsid[] = "@(#)from.c 8.1 (Berkeley) 6/6/93"; #endif -static char rcsid[] = "$OpenBSD: from.c,v 1.4 1998/07/10 15:51:20 mickey Exp $"; +static char rcsid[] = "$OpenBSD: from.c,v 1.5 1999/08/26 14:17:20 aaron Exp $"; #endif /* not lint */ #include @@ -103,15 +103,17 @@ if (!(pwd = getpwuid(getuid()))) errx(1, "no password file entry for you"); if (file = getenv("USER")) { - (void)sprintf(buf, "%s/%s", - _PATH_MAILDIR, file); + (void)snprintf(buf, sizeof(buf), + "%s/%s", _PATH_MAILDIR, file); file = buf; } else - (void)sprintf(file = buf, "%s/%s", - _PATH_MAILDIR, pwd->pw_name); + (void)snprintf(file = buf, sizeof(buf), + "%s/%s", _PATH_MAILDIR, + pwd->pw_name); } } else { - (void)sprintf(buf, "%s/%s", _PATH_MAILDIR, file); + (void)snprintf(buf, sizeof(buf), "%s/%s", + _PATH_MAILDIR, file); file = buf; } }