From: Robert Pengelly Date: Thu, 30 Jul 2026 07:57:27 +0000 (+0100) Subject: Stop hard coding partition numbers X-Git-Url: https://git.candlhat.org/?a=commitdiff_plain;h=4ab113278874d3d7398a6bce0b30ae3c2a328664;p=parted.git Stop hard coding partition numbers --- diff --git a/lib.c b/lib.c index 943bb2d..2e1ffa8 100644 --- a/lib.c +++ b/lib.c @@ -389,23 +389,10 @@ void parse_args (int *pargc, char ***pargv, int optind) { } - switch (conversion) { - - case 0x01: - case 0x04: - case 0x06: - case 0x0B: - case 0x0C: - case 0x0E: - case 0x80: - case 0xEF: - - break; - - default: - - report_at (program_name, 0, REPORT_ERROR, "unsupported partition type provided"); - exit (EXIT_FAILURE); + if (conversion < 0 || conversion > 0xff) { + + report_at (program_name, 0, REPORT_ERROR, "unsupported partition type provided"); + exit (EXIT_FAILURE); }