1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-13 11:29:58 +03:00

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`.
This commit is contained in:
Alexander 2024-08-17 21:25:39 +03:00 committed by GitHub
parent 91439e0ac2
commit fcecabf01e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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;
}
}