diff --git a/usr.bin/from/from.c b/usr.bin/from/from.c index ff3581d25e8d..a8dffbb9ba93 100644 --- a/usr.bin/from/from.c +++ b/usr.bin/from/from.c @@ -96,14 +96,14 @@ main(argc, argv) if (!file) { if (*argv) { - (void)sprintf(buf, "%s/%s", _PATH_MAILDIR, *argv); + (void)snprintf(buf, sizeof(buf), "%s/%s", _PATH_MAILDIR, *argv); file = buf; } else { if (!(file = getenv("MAIL"))) { if (!(pwd = getpwuid(getuid()))) errx(1, "no password file entry for you"); file = pwd->pw_name; - (void)sprintf(buf, + (void)snprintf(buf, sizeof(buf), "%s/%s", _PATH_MAILDIR, file); file = buf; }