From 963675689cd22252d06dd836a49bff8adc38e6f0 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 28 Jun 2018 11:05:22 +1000 Subject: [PATCH] HAL_ChibiOS: fixed substitution of %BOARD%-BL --- libraries/AP_HAL_ChibiOS/hwdef/common/usbcfg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/AP_HAL_ChibiOS/hwdef/common/usbcfg.c b/libraries/AP_HAL_ChibiOS/hwdef/common/usbcfg.c index 6c2102c216..285aebcbdc 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/common/usbcfg.c +++ b/libraries/AP_HAL_ChibiOS/hwdef/common/usbcfg.c @@ -216,13 +216,13 @@ static void string_substitute(const char *str, char *str2) while (*str) { char c = *str; if (c == '%') { - if (strcmp(str, "%BOARD%") == 0) { + if (strncmp(str, "%BOARD%", 7) == 0) { memcpy(p, HAL_BOARD_NAME, strlen(HAL_BOARD_NAME)); str += 7; p += strlen(HAL_BOARD_NAME); continue; } - if (strcmp(str, "%SERIAL%") == 0) { + if (strncmp(str, "%SERIAL%", 8) == 0) { const char *hex = "0123456789ABCDEF"; const uint8_t *cpu_id = (const uint8_t *)UDID_START; uint8_t i;