diff options
author | kris <kris@FreeBSD.org> | 2000-11-26 10:05:06 +0000 |
---|---|---|
committer | kris <kris@FreeBSD.org> | 2000-11-26 10:05:06 +0000 |
commit | a6b6cceedcf79fc4c5cdcc151410cce4460c6961 (patch) | |
tree | 7e4953729307cadea1959b850ced93ebc0f86319 /libexec/atrun | |
parent | fca882bcb572da6f24be4f18fd403000f88fc471 (diff) | |
download | FreeBSD-src-a6b6cceedcf79fc4c5cdcc151410cce4460c6961.zip FreeBSD-src-a6b6cceedcf79fc4c5cdcc151410cce4460c6961.tar.gz |
Don't hard-code a buffer size
Diffstat (limited to 'libexec/atrun')
-rw-r--r-- | libexec/atrun/atrun.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libexec/atrun/atrun.c b/libexec/atrun/atrun.c index ae9ebc9..444b3dc 100644 --- a/libexec/atrun/atrun.c +++ b/libexec/atrun/atrun.c @@ -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); |