diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2003-03-15 00:39:02 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2003-03-15 00:39:02 +0000 |
commit | f5a7957305ac9d2273318b55c0809a89c963d2b4 (patch) | |
tree | 9525c8f5c0fa8f66ebefb677a4165438684a1d8f /usr.sbin/cron/database.c | |
parent | f1d98055dcb74848e99477cbc7525a620e956e73 (diff) |
Use strlcpy() instead of pre-checking the src len and using strcpy()
Diffstat (limited to 'usr.sbin/cron/database.c')
-rw-r--r-- | usr.sbin/cron/database.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/usr.sbin/cron/database.c b/usr.sbin/cron/database.c index 52668b2ba63..f4887f546ee 100644 --- a/usr.sbin/cron/database.c +++ b/usr.sbin/cron/database.c @@ -1,4 +1,4 @@ -/* $OpenBSD: database.c,v 1.12 2003/02/20 20:38:08 millert Exp $ */ +/* $OpenBSD: database.c,v 1.13 2003/03/15 00:39:01 millert Exp $ */ /* Copyright 1988,1990,1993,1994 by Paul Vixie * All rights reserved @@ -22,7 +22,7 @@ */ #if !defined(lint) && !defined(LINT) -static char const rcsid[] = "$OpenBSD: database.c,v 1.12 2003/02/20 20:38:08 millert Exp $"; +static char const rcsid[] = "$OpenBSD: database.c,v 1.13 2003/03/15 00:39:01 millert Exp $"; #endif /* vix 26jan87 [RCS has the log] @@ -106,9 +106,8 @@ load_database(cron_db *old_db) { if (dp->d_name[0] == '.') continue; - if (strlen(dp->d_name) >= sizeof fname) + if (strlcpy(fname, dp->d_name, sizeof fname) >= sizeof fname) continue; /* XXX log? */ - (void) strcpy(fname, dp->d_name); if (!glue_strings(tabname, sizeof tabname, SPOOL_DIR, fname, '/')) |