summaryrefslogtreecommitdiff
path: root/sbin/bioctl/bioctl.c
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2011-07-04 04:52:35 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2011-07-04 04:52:35 +0000
commitd4681cd5b3717e4b27b6aef1ff047b8f5211a696 (patch)
treef1730ce86b8e93a6f711624b5cb04eccf126e994 /sbin/bioctl/bioctl.c
parent52566394a89be8a4dfd3378b85b22117a430d6e1 (diff)
use stronum, removing an atoi from the tree. ok deraadt matthew
Diffstat (limited to 'sbin/bioctl/bioctl.c')
-rw-r--r--sbin/bioctl/bioctl.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sbin/bioctl/bioctl.c b/sbin/bioctl/bioctl.c
index ee1fd477d2e..c88d2fffc6e 100644
--- a/sbin/bioctl/bioctl.c
+++ b/sbin/bioctl/bioctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bioctl.c,v 1.99 2011/04/04 15:22:31 jcs Exp $ */
+/* $OpenBSD: bioctl.c,v 1.100 2011/07/04 04:52:34 tedu Exp $ */
/*
* Copyright (c) 2004, 2005 Marco Peereboom
@@ -124,9 +124,11 @@ main(int argc, char *argv[])
break;
case 'c': /* create */
func |= BIOC_CREATERAID;
- if (isdigit(*optarg))
- cr_level = atoi(optarg);
- else
+ if (isdigit(*optarg)) {
+ cr_level = strtonum(optarg, 0, 10, &errstr);
+ if (errstr != NULL)
+ errx(1, "Invalid RAID level");
+ } else
cr_level = *optarg;
break;
case 'd':