mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-25 01:05:27 +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;
|
||||
int len;
|
||||
#if defined(USE_CUSTOM_BOX_NAMES)
|
||||
if (name == NULL
|
||||
&& box->boxId >= BOXUSER1 && box->boxId <= BOXUSER4) {
|
||||
if (box->boxId >= BOXUSER1 && box->boxId <= BOXUSER4) {
|
||||
const int n = box->boxId - BOXUSER1;
|
||||
name = modeActivationConfig()->box_user_names[n];
|
||||
// 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
|
||||
if (name == NULL) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue