diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2021-06-10 21:28:44 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2021-06-10 21:28:44 +0000 |
commit | 28cbf40ea6d7f64231d29233c31612379feb0940 (patch) | |
tree | c138d2040b3c85d82916cb94cc0a678081280f7c /sbin | |
parent | 8cf96700690382e2225de03c7c5e52058417eda1 (diff) |
Missed an occurance of hand rolled partition number parsing.
No intentional funtional change.
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/fdisk/cmd.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/sbin/fdisk/cmd.c b/sbin/fdisk/cmd.c index c1cabeba0bc..e0b823a84b9 100644 --- a/sbin/fdisk/cmd.c +++ b/sbin/fdisk/cmd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd.c,v 1.107 2021/06/10 18:41:52 krw Exp $ */ +/* $OpenBSD: cmd.c,v 1.108 2021/06/10 21:28:43 krw Exp $ */ /* * Copyright (c) 1997 Tobias Weingartner @@ -500,23 +500,16 @@ int Xflag(char *args, struct mbr *mbr) { const char *errstr; - int i, maxpn, pn = -1; + int i, pn; long long val = -1; char *part, *flag; flag = args; part = strsep(&flag, " \t"); - if (letoh64(gh.gh_sig) == GPTSIGNATURE) - maxpn = NGPTPARTITIONS - 1; - else - maxpn = NDOSPART - 1; - - pn = strtonum(part, 0, maxpn, &errstr); - if (errstr) { - printf("partition number is %s: %s.\n", errstr, part); + pn = parsepn(part); + if (pn == -1) return (CMD_CONT); - } if (flag != NULL) { /* Set flag to value provided. */ |