From c35f784a9f63040c8bc044377c03bbae2079fe08 Mon Sep 17 00:00:00 2001 From: Oliver O'Halloran Date: Thu, 30 Nov 2017 16:31:24 +1100 Subject: gard: Fix up path parsing Currently we assume that the Unit ID can be used as an array index into the chip_units[] structure. There are holes in the ID space though, so this doesn't actually work. Fix it up by walking the array looking for the ID. Signed-off-by: Oliver O'Halloran Signed-off-by: Stewart Smith --- external/gard/gard.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'external') diff --git a/external/gard/gard.c b/external/gard/gard.c index c70fa2a..5a57415 100644 --- a/external/gard/gard.c +++ b/external/gard/gard.c @@ -325,7 +325,7 @@ int parse_path(const char *str, struct entity_path *parsed) parsed->path_elements[unit_count].target_type = unit_id; /* now parse the instance # */ - len = strlen(chip_units[unit_id].desc); + len = strlen(target_type_to_str(unit_id)); instance = strtol(str + len, &end, 10); if (!isdigit(*(str + len))) { -- cgit v1.1