X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Ftarget%2Fimage.c;h=d72680d1b763499646635c47a4cea7c7791db44e;hb=c977616cdad17ad74742ede8703f54e370c3947d;hp=71939e79b92e6cb73bae40a7e8d3df44396e848b;hpb=cafad4969c306c87954c8bd681068932dae68a41;p=fw%2Fopenocd diff --git a/src/target/image.c b/src/target/image.c index 71939e79b..d72680d1b 100644 --- a/src/target/image.c +++ b/src/target/image.c @@ -711,10 +711,11 @@ int image_open(image_t *image, char *url, char *type_string) } else if (image->type == IMAGE_MEMORY) { - target_t *target = get_target_by_num(strtoul(url, NULL, 0)); - if (target==NULL) + target_t *target = get_target(url); + + if (target == NULL) { - LOG_ERROR("Target '%s' does not exist", url); + LOG_ERROR("target '%s' not defined", url); return ERROR_FAIL; }