From e7a1a7d809c55a9a224975e10a9464a2440948bd Mon Sep 17 00:00:00 2001 From: Greg Lehey Date: Thu, 2 Mar 2000 07:46:10 +0000 Subject: Fix a problem with device number parsing, which caused da10 to map to da1, and da11 to da2. Reported by: Dan Nelson Implicitly-approved-by: jkh --- sys/dev/vinum/vinumio.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'sys') diff --git a/sys/dev/vinum/vinumio.c b/sys/dev/vinum/vinumio.c index 50203e327b33..17fc5fe37f79 100644 --- a/sys/dev/vinum/vinumio.c +++ b/sys/dev/vinum/vinumio.c @@ -90,9 +90,9 @@ open_drive(struct drive *drive, struct proc *p, int verbose) * Create a minor number for each of them. */ unit = 0; - while ((dname[0] >= '0') /* invalid unit */ - &&(dname[0] <= '9')) { - unit += dname[0] - '0'; + while ((*dname >= '0') /* unit number */ + &&(*dname <= '9')) { + unit = unit * 10 + *dname - '0'; dname++; } @@ -104,9 +104,9 @@ open_drive(struct drive *drive, struct proc *p, int verbose) +(dname[2] - 'a') /* partition */ +((dname[1] - '0' + 1) << 16); /* slice */ } else { /* compatibility partition */ - if ((dname[0] < 'a') || (dname[0] > 'h')) /* or invalid partition */ + if ((*dname < 'a') || (*dname > 'h')) /* or invalid partition */ return ENODEV; - devminor = (dname[0] - 'a') /* partition */ + devminor = (*dname - 'a') /* partition */ +(unit << 3); /* unit */ } -- cgit v1.3