From fcecabf01e611f97b59c4af8138da14b1e7c8e4e Mon Sep 17 00:00:00 2001 From: Alexander Date: Sat, 17 Aug 2024 21:25:39 +0300 Subject: [PATCH] Fix searching a resource (#13826) If you add a new resource whose name starts with an existing resource name it won't be found. For example if you add `PWM_EX` resource after `PWM` you won't be able to store a pin into it. So when you execute `resource PWM_EX 1 A01` it will be stored into `PWM`. --- src/main/cli/cli.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/cli/cli.c b/src/main/cli/cli.c index 182a6a8f95..207a021443 100644 --- a/src/main/cli/cli.c +++ b/src/main/cli/cli.c @@ -6050,7 +6050,7 @@ static void cliResource(const char *cmdName, char *cmdline) } const char *resourceName = ownerNames[resourceTable[resourceIndex].owner]; - if (strncasecmp(pch, resourceName, strlen(resourceName)) == 0) { + if (strcasecmp(pch, resourceName) == 0) { break; } }