summaryrefslogtreecommitdiffstats
path: root/usr.sbin/cron/crontab/crontab.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/cron/crontab/crontab.c')
-rw-r--r--usr.sbin/cron/crontab/crontab.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/usr.sbin/cron/crontab/crontab.c b/usr.sbin/cron/crontab/crontab.c
index 676c903..fbf6048 100644
--- a/usr.sbin/cron/crontab/crontab.c
+++ b/usr.sbin/cron/crontab/crontab.c
@@ -17,7 +17,7 @@
*/
#if !defined(lint) && !defined(LINT)
-static char rcsid[] = "$Id: crontab.c,v 1.3 1995/05/30 03:47:04 rgrimes Exp $";
+static char rcsid[] = "$Id: crontab.c,v 1.4 1996/04/09 20:28:16 scrappy Exp $";
#endif
/* crontab - install and manage per-user crontab files
@@ -167,7 +167,7 @@ parse_args(argc, argv)
ProgramName, optarg);
exit(ERROR_EXIT);
}
- (void) strcpy(User, optarg);
+ (void) snprintf(User, sizeof(user), "%s", optarg);
break;
case 'l':
if (Option != opt_unknown)
@@ -198,7 +198,8 @@ parse_args(argc, argv)
} else {
if (argv[optind] != NULL) {
Option = opt_replace;
- (void) strcpy (Filename, argv[optind]);
+ (void) snprintf(Filename, sizeof(Filename), "%s",
+ argv[optind]);
} else {
usage("file name must be specified for replace");
}
@@ -480,7 +481,8 @@ edit_cmd() {
ProgramName, Filename);
goto done;
default:
- fprintf(stderr, "%s: panic: bad switch() in replace_cmd()\n");
+ fprintf(stderr, "%s: panic: bad switch() in replace_cmd()\n",
+ ProgramName);
goto fatal;
}
remove:
OpenPOWER on IntegriCloud