diff options
author | Dima Dorfman <dd@FreeBSD.org> | 2001-06-21 01:39:01 +0000 |
---|---|---|
committer | Dima Dorfman <dd@FreeBSD.org> | 2001-06-21 01:39:01 +0000 |
commit | 78baea25b2982b7e696dbe01c15691c3360a68ff (patch) | |
tree | 7ca5906ddf62556a7605ca2314b242c13535f36c /sbin/mdconfig | |
parent | 2885b42173ff360c66e7db1c094566c1ad73060f (diff) | |
download | src-78baea25b2982b7e696dbe01c15691c3360a68ff.tar.gz src-78baea25b2982b7e696dbe01c15691c3360a68ff.zip |
Don't assume the length of MD_NAME is 2.
Notes
Notes:
svn path=/head/; revision=78525
Diffstat (limited to 'sbin/mdconfig')
-rw-r--r-- | sbin/mdconfig/mdconfig.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sbin/mdconfig/mdconfig.c b/sbin/mdconfig/mdconfig.c index cdf5de93672e..15cbbef58a28 100644 --- a/sbin/mdconfig/mdconfig.c +++ b/sbin/mdconfig/mdconfig.c @@ -147,7 +147,7 @@ main(int argc, char **argv) if (!strncmp(optarg, "/dev/", 5)) optarg += 5; if (!strncmp(optarg, MD_NAME, sizeof(MD_NAME) - 1)) - optarg += 2; + optarg += sizeof(MD_NAME) - 1; mdio.md_unit = strtoul(optarg, &p, 0); if ((unsigned)mdio.md_unit == ULONG_MAX || *p != '\0') errx(1, "bad unit: %s", optarg); @@ -214,7 +214,7 @@ list(const int fd) (p2 = strsep(&p, " ")) != NULL;) { if (strncmp(p2, MD_NAME, sizeof(MD_NAME) - 1) != 0) continue; - p2 += 2; + p2 += sizeof(MD_NAME) - 1; unit = strtoul(p2, &p3, 10); if (p2 == p3) continue; |