summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Campbell <aaron@cvs.openbsd.org>1999-08-26 14:17:21 +0000
committerAaron Campbell <aaron@cvs.openbsd.org>1999-08-26 14:17:21 +0000
commit8b14ca7f799d87bc5e3539c54b4ae8717190449f (patch)
treef0d87c1726dd518ada8cd2aa6dc0a24ae0d82075
parent8b82015376bf2392f73e0fdd134451598a7fcf47 (diff)
fix a few more boflows; millert@ ok
-rw-r--r--usr.bin/from/from.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/usr.bin/from/from.c b/usr.bin/from/from.c
index 51ffbeaa900..7a79c228ff7 100644
--- a/usr.bin/from/from.c
+++ b/usr.bin/from/from.c
@@ -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 @@ static char copyright[] =
#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 <sys/types.h>
@@ -103,15 +103,17 @@ main(argc, argv)
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;
}
}