From 8c16729962be9a359debf34473fbe7dae81a1b4c Mon Sep 17 00:00:00 2001 From: krw Date: Thu, 10 Jun 2021 22:27:37 +0000 Subject: [PATCH] Another hand rolled partition number parsing bites the dust. --- sbin/fdisk/cmd.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/sbin/fdisk/cmd.c b/sbin/fdisk/cmd.c index e0b823a84b9..7f4682661ce 100644 --- a/sbin/fdisk/cmd.c +++ b/sbin/fdisk/cmd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd.c,v 1.108 2021/06/10 21:28:43 krw Exp $ */ +/* $OpenBSD: cmd.c,v 1.109 2021/06/10 22:27:37 krw Exp $ */ /* * Copyright (c) 1997 Tobias Weingartner @@ -291,16 +291,13 @@ done: int gsetpid(char *args) { - const char *errstr; struct uuid guid; struct gpt_partition *gg; int pn, num, status; - pn = strtonum(args, 0, NGPTPARTITIONS - 1, &errstr); - if (errstr) { - printf("partition number is %s: %s\n", errstr, args); + pn = parsepn(args); + if (pn == -1) return (CMD_CONT); - } gg = &gp[pn]; /* Print out current table entry */ -- 2.20.1