git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@13965 27425a3e-05d8-49a3-a47f-9c15f0e5edd8
This commit is contained in:
Giovanni Di Sirio 2020-12-19 11:03:42 +00:00
parent c7c89b1682
commit ce263870a7
2 changed files with 15 additions and 8 deletions

View File

@ -83,6 +83,17 @@ objects_factory_t ch_factory;
/* Module local functions. */
/*===========================================================================*/
static void copy_name(const char *sp, char *dp) {
unsigned i;
i = 0U;
while ((*sp != (char)0) && (i < CH_CFG_FACTORY_MAX_NAMES_LENGTH)) {
*dp = *sp;
sp++;
dp++;
}
}
static inline void dyn_list_init(dyn_list_t *dlp) {
dlp->next = (dyn_element_t *)dlp;
@ -135,16 +146,13 @@ static dyn_element_t *dyn_create_object_heap(const char *name,
}
/* Allocating space for the new buffer object.*/
/*lint -save -e668 [] Lint is confused by the above chDbgCheck() and
incorrectly assumes that strncpy() could receive a NULL pointer.*/
dep = (dyn_element_t *)chHeapAlloc(NULL, size);
if (dep == NULL) {
return NULL;
}
/* Initializing object list element.*/
strncpy(dep->name, name, CH_CFG_FACTORY_MAX_NAMES_LENGTH);
/*lint -restore*/
copy_name(name, dep->name);
dep->refs = (ucnt_t)1;
dep->next = dlp->next;
@ -189,10 +197,7 @@ static dyn_element_t *dyn_create_object_pool(const char *name,
}
/* Initializing object list element.*/
/*lint -save -e668 [] Lint is confused by the above chDbgCheck() and
incorrectly assumes that strncpy() could receive a NULL pointer.*/
strncpy(dep->name, name, CH_CFG_FACTORY_MAX_NAMES_LENGTH);
/*lint -restore*/
copy_name(name, dep->name);
dep->refs = (ucnt_t)1;
dep->next = dlp->next;

View File

@ -126,6 +126,8 @@
MEMS Accelerometers.
- NEW: Safer messages mechanism for sandboxes (to be backported to 20.3.1).
- NEW: Added latency measurement test application.
- FIX: Fixed GCC 10 causes warning in factory module (bug #1139)
(backported to 20.3.3)(backported to 19.1.5).
- FIX: Fixed STM32H7xx Missing CRC RCC macros (bug #1137)
(backported to 20.3.3).
- FIX: Fixed STM32L0x wrong ISR names for USART 4 and 5 (bug #1136)