diff options
author | nyan <nyan@FreeBSD.org> | 2005-05-01 05:01:55 +0000 |
---|---|---|
committer | nyan <nyan@FreeBSD.org> | 2005-05-01 05:01:55 +0000 |
commit | fa2fcbedc1aeeab07a47a833fb481458d0049b9b (patch) | |
tree | 59413ed49489bdf54c4297279d989e899be670d1 /sbin/fdisk/fdisk.c | |
parent | 27eb420eea77759fca3dd42d2b1575bc6c9a2e9e (diff) | |
download | FreeBSD-src-fa2fcbedc1aeeab07a47a833fb481458d0049b9b.zip FreeBSD-src-fa2fcbedc1aeeab07a47a833fb481458d0049b9b.tar.gz |
Use NDOSPART macro instead of a magic number.
Diffstat (limited to 'sbin/fdisk/fdisk.c')
-rw-r--r-- | sbin/fdisk/fdisk.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sbin/fdisk/fdisk.c b/sbin/fdisk/fdisk.c index ed71867..5840f86 100644 --- a/sbin/fdisk/fdisk.c +++ b/sbin/fdisk/fdisk.c @@ -715,8 +715,8 @@ open_disk(int flag) fd = open(disk, O_RDONLY); if (fd == -1) return -3; - for (p = 1; p < 5; p++) { - asprintf(&s, "%ss%d", disk, p); + for (p = 0; p < NDOSPART; p++) { + asprintf(&s, "%ss%d", disk, p + 1); fdw = open(s, rwmode); free(s); if (fdw == -1) |