mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-26 01:35:41 +03:00
parent
a7672a0a1e
commit
713ba21407
1 changed files with 6 additions and 3 deletions
|
@ -142,12 +142,15 @@ int serializeBoxNameFn(sbuf_t *dst, const box_t *box)
|
||||||
const char* name = NULL;
|
const char* name = NULL;
|
||||||
int len;
|
int len;
|
||||||
#if defined(USE_CUSTOM_BOX_NAMES)
|
#if defined(USE_CUSTOM_BOX_NAMES)
|
||||||
if (name == NULL
|
if (box->boxId >= BOXUSER1 && box->boxId <= BOXUSER4) {
|
||||||
&& box->boxId >= BOXUSER1 && box->boxId <= BOXUSER4) {
|
|
||||||
const int n = box->boxId - BOXUSER1;
|
const int n = box->boxId - BOXUSER1;
|
||||||
name = modeActivationConfig()->box_user_names[n];
|
name = modeActivationConfig()->box_user_names[n];
|
||||||
// possibly there is no '\0' in boxname
|
// possibly there is no '\0' in boxname
|
||||||
len = strnlen(name, sizeof(modeActivationConfig()->box_user_names[0]));
|
if (*name) {
|
||||||
|
len = strnlen(name, sizeof(modeActivationConfig()->box_user_names[n]));
|
||||||
|
} else {
|
||||||
|
name = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (name == NULL) {
|
if (name == NULL) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue