Stop hard coding partition numbers
authorRobert Pengelly <robertapengelly@hotmail.com>
Thu, 30 Jul 2026 07:57:27 +0000 (08:57 +0100)
committerRobert Pengelly <robertapengelly@hotmail.com>
Thu, 30 Jul 2026 07:57:27 +0000 (08:57 +0100)
lib.c

diff --git a/lib.c b/lib.c
index 943bb2d6cb0caa698fdbff242c2cbf07d07f88c1..2e1ffa85057bfb2d8f0c5e969f3f0d5b3d26a7c8 100644 (file)
--- 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);
                 
                 }