@@ -435,6 +435,7 @@ void print_part (block_dev_desc_t * dev_desc)
#endif
+#define MAX_SEARCH_PARTITIONS 16
int get_device_and_partition(const char *ifname, const char *dev_str,
block_dev_desc_t **dev_desc,
disk_partition_t *info)
@@ -484,7 +485,7 @@ int get_device_and_partition(const char *ifname, const char *dev_str,
} else {
/* find the first bootable partition. If none are bootable,
* fall back to the first valid partition */
- for (p = 1; p < 16; p++) {
+ for (p = 1; p <= MAX_SEARCH_PARTITIONS; p++) {
ret = get_partition_info(desc, p, info);
if (ret)
continue;