summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sbin/mount_tcfs/mount_tcfs.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/sbin/mount_tcfs/mount_tcfs.c b/sbin/mount_tcfs/mount_tcfs.c
index 2c97d8361d8..f2bf9989336 100644
--- a/sbin/mount_tcfs/mount_tcfs.c
+++ b/sbin/mount_tcfs/mount_tcfs.c
@@ -83,8 +83,14 @@ main(argc, argv)
switch(ch) {
case 'o':
getmntopts(optarg, mopts, &mntflags, &altflags);
- if (altflags & ALTF_CIPHER)
- args.cipher_num = atoi(strstr(optarg, "cipher=" + 7));
+ if (altflags & ALTF_CIPHER) {
+ char *p, *cipherfield;
+
+ cipherfield = strstr(optarg, "cipher=") + 7;
+ args.cipher_num = strtol(cipherfield, &p, 0);
+ if (cipherfield == p)
+ args.cipher_num = -1;
+ }
altflags = 0;
break;
case '?':
@@ -109,7 +115,6 @@ main(argc, argv)
exit(1);
}
args.target = target;
-
if (mount(MOUNT_TCFS, argv[1], mntflags, &args))
err(1, "%s", "");