diff --git a/src/main/pg/board.c b/src/main/pg/board.c index 7f197f110c..28f692c867 100644 --- a/src/main/pg/board.c +++ b/src/main/pg/board.c @@ -37,14 +37,14 @@ PG_REGISTER_WITH_RESET_FN(boardConfig_t, boardConfig, PG_BOARD_CONFIG, 0); void pgResetFn_boardConfig(boardConfig_t *boardConfig) { if (boardInformationIsSet()) { - strncpy(boardConfig->manufacturerId, getManufacturerId(), MAX_MANUFACTURER_ID_LENGTH); - strncpy(boardConfig->boardName, getBoardName(), MAX_BOARD_NAME_LENGTH); + strncpy(boardConfig->manufacturerId, getManufacturerId(), MAX_MANUFACTURER_ID_LENGTH + 1); + strncpy(boardConfig->boardName, getBoardName(), MAX_BOARD_NAME_LENGTH + 1); boardConfig->boardInformationSet = true; } else { #if !defined(GENERIC_TARGET) - strncpy(boardConfig->boardName, targetName, MAX_BOARD_NAME_LENGTH); + strncpy(boardConfig->boardName, targetName, MAX_BOARD_NAME_LENGTH + 1); #if defined(TARGET_MANUFACTURER_IDENTIFIER) - memcpy(boardConfig->manufacturerId, TARGET_MANUFACTURER_IDENTIFIER, MAX_MANUFACTURER_ID_LENGTH); + strncpy(boardConfig->manufacturerId, TARGET_MANUFACTURER_IDENTIFIER, MAX_MANUFACTURER_ID_LENGTH + 1); #endif boardConfig->boardInformationSet = true; #else