diff options
author | 2005-08-03 03:01:31 +0000 | |
---|---|---|
committer | 2005-08-03 03:01:31 +0000 | |
commit | e4e14ad7683f9ce25029eb9a922467899c30016c (patch) | |
tree | 396bd12e5efbb85e5f3cb6853cbba90fbe97c931 | |
parent | various cleanups, the way i like it, ok marco (diff) | |
download | wireguard-openbsd-e4e14ad7683f9ce25029eb9a922467899c30016c.tar.xz wireguard-openbsd-e4e14ad7683f9ce25029eb9a922467899c30016c.zip |
be more sure about what is a drive vs controller; ok marco
-rw-r--r-- | sbin/bioctl/bioctl.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sbin/bioctl/bioctl.c b/sbin/bioctl/bioctl.c index eab5079cae7..3fa9d99b718 100644 --- a/sbin/bioctl/bioctl.c +++ b/sbin/bioctl/bioctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bioctl.c,v 1.19 2005/08/03 02:39:55 deraadt Exp $ */ +/* $OpenBSD: bioctl.c,v 1.20 2005/08/03 03:01:31 deraadt Exp $ */ /* * Copyright (c) 2004, 2005 Marco Peereboom @@ -41,6 +41,7 @@ #include <stdlib.h> #include <string.h> #include <unistd.h> +#include <ctype.h> #include <util.h> #include "bioctl.h" @@ -89,7 +90,9 @@ main(int argc, char *argv[]) if (argc < 0 || argc > 1) usage(); - if (strncmp(argv[0], "sd", 2) == 0) + /* if at least glob sd[0-9]*, it is a drive identifier */ + if (strncmp(argv[0], "sd", 2) == 0 && strlen(argv[0]) > 2 && + isdigit(argv[0][2])) sd_dev = argv[0]; else bioc_dev = argv[0]; |