From 4ab113278874d3d7398a6bce0b30ae3c2a328664 Mon Sep 17 00:00:00 2001 From: Robert Pengelly Date: Thu, 30 Jul 2026 08:57:27 +0100 Subject: [PATCH] Stop hard coding partition numbers --- lib.c | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) 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); } -- 2.34.1