summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2004-07-21 17:02:36 +0000
committerimp <imp@FreeBSD.org>2004-07-21 17:02:36 +0000
commit21933e4a30a2461cf5fc1960333c6f721eacc3de (patch)
treea2fb8d00a75e0504078b301696a2e8421dacb510
parent56906f9f7265c34d8cb0444e9246ed007ba52f4c (diff)
downloadFreeBSD-src-21933e4a30a2461cf5fc1960333c6f721eacc3de.zip
FreeBSD-src-21933e4a30a2461cf5fc1960333c6f721eacc3de.tar.gz
Two style related changes:
(1) use strlcpy instead of strncpy since the use here of the latter was incorrect. (2) Move 'N' case into proper sorted order (sorted the same way that ls sorts its args).
-rw-r--r--usr.sbin/pwd_mkdb/pwd_mkdb.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.sbin/pwd_mkdb/pwd_mkdb.c b/usr.sbin/pwd_mkdb/pwd_mkdb.c
index 4991715..5731aef 100644
--- a/usr.sbin/pwd_mkdb/pwd_mkdb.c
+++ b/usr.sbin/pwd_mkdb/pwd_mkdb.c
@@ -122,13 +122,16 @@ main(int argc, char *argv[])
strcpy(prefix, _PATH_PWD);
makeold = 0;
username = NULL;
- while ((ch = getopt(argc, argv, "Cd:ps:u:vN")) != -1)
+ while ((ch = getopt(argc, argv, "CNd:ps:u:v")) != -1)
switch(ch) {
case 'C': /* verify only */
Cflag = 1;
break;
+ case 'N': /* do not wait for lock */
+ nblock = LOCK_NB; /* will fail if locked */
+ break;
case 'd':
- strncpy(prefix, optarg, sizeof prefix - 1);
+ strlcpy(prefix, optarg, sizeof(prefix));
break;
case 'p': /* create V7 "file.orig" */
makeold = 1;
@@ -141,9 +144,6 @@ main(int argc, char *argv[])
break;
case 'v': /* backward compatible */
break;
- case 'N': /* do not wait for lock */
- nblock = LOCK_NB;
- break;
default:
usage();
}
OpenPOWER on IntegriCloud