diff options
author | pjd <pjd@FreeBSD.org> | 2010-09-15 21:37:26 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2010-09-15 21:37:26 +0000 |
commit | 51d5293d0c39c6e91cbb9d7ef18f8d109dfaf939 (patch) | |
tree | 15f6109d14aecf8501b58d5e5c941c6939c07cab /sbin | |
parent | 2eed3d504fdd31e019cc71a55dfb1c15ca41f167 (diff) | |
download | FreeBSD-src-51d5293d0c39c6e91cbb9d7ef18f8d109dfaf939.zip FreeBSD-src-51d5293d0c39c6e91cbb9d7ef18f8d109dfaf939.tar.gz |
GPART_PARAM_INDEX is now G_TYPE_NUMBER.
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/geom/class/part/geom_part.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/sbin/geom/class/part/geom_part.c b/sbin/geom/class/part/geom_part.c index 1a0efba..64abf4c 100644 --- a/sbin/geom/class/part/geom_part.c +++ b/sbin/geom/class/part/geom_part.c @@ -285,12 +285,10 @@ gpart_autofill_resize(struct gctl_req *req) off_t last, size, start, new_size; off_t lba, new_lba; const char *s; - char *val; int error, idx; - s = gctl_get_ascii(req, GPART_PARAM_INDEX); - idx = strtol(s, &val, 10); - if (idx < 1 || *s == '\0' || *val != '\0') + idx = (int)gctl_get_intmax(req, GPART_PARAM_INDEX); + if (idx < 1) errx(EXIT_FAILURE, "invalid partition index"); error = geom_gettree(&mesh); @@ -775,7 +773,6 @@ gpart_bootcode(struct gctl_req *req, unsigned int fl) struct gclass *classp; struct ggeom *gp; const char *s; - char *sp; void *bootcode, *partcode; size_t bootsize, partsize; int error, idx, vtoc8; @@ -830,9 +827,8 @@ gpart_bootcode(struct gctl_req *req, unsigned int fl) if (gctl_has_param(req, GPART_PARAM_INDEX)) { if (partcode == NULL) errx(EXIT_FAILURE, "-i is only valid with -p"); - s = gctl_get_ascii(req, GPART_PARAM_INDEX); - idx = strtol(s, &sp, 10); - if (idx < 1 || *s == '\0' || *sp != '\0') + idx = (int)gctl_get_intmax(req, GPART_PARAM_INDEX); + if (idx < 1) errx(EXIT_FAILURE, "invalid partition index"); error = gctl_delete_param(req, GPART_PARAM_INDEX); if (error) |