mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-11-27 02:42:46 +00:00
Don't hard-code a buffer size
This commit is contained in:
parent
17c9715049
commit
18fdc5893a
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=69199
@ -209,7 +209,8 @@ run_file(const char *filename, uid_t uid, gid_t gid)
|
||||
|
||||
fcntl(fd_in, F_SETFD, fflags & ~FD_CLOEXEC);
|
||||
|
||||
snprintf(fmt, 49, "#!/bin/sh\n# atrun uid=%%ld gid=%%ld\n# mail %%%ds %%d",
|
||||
snprintf(fmt, sizeof(fmt),
|
||||
"#!/bin/sh\n# atrun uid=%%ld gid=%%ld\n# mail %%%ds %%d",
|
||||
LOGNAMESIZE);
|
||||
if (fscanf(stream, fmt, &nuid, &ngid, mailbuf, &send_mail) != 4) {
|
||||
syslog(LOG_ERR,"File %s is in wrong format - aborting", filename);
|
||||
|
Loading…
Reference in New Issue
Block a user