diff options
author | Giovanni Di Sirio <gdisirio@gmail.com> | 2018-02-10 10:10:57 +0000 |
---|---|---|
committer | Giovanni Di Sirio <gdisirio@gmail.com> | 2018-02-10 10:10:57 +0000 |
commit | b4dde0d786e73cea46a49965fcb25333edc7abee (patch) | |
tree | 22b143ef4ee01775e606bf787379983bd13e431b /os | |
parent | d92635464e25e3b51e3d249a0e58dc393a311313 (diff) | |
download | ChibiOS-b4dde0d786e73cea46a49965fcb25333edc7abee.tar.gz ChibiOS-b4dde0d786e73cea46a49965fcb25333edc7abee.tar.bz2 ChibiOS-b4dde0d786e73cea46a49965fcb25333edc7abee.zip |
MISRA-related changes.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@11470 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os')
-rw-r--r-- | os/common/oslib/src/chfactory.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/os/common/oslib/src/chfactory.c b/os/common/oslib/src/chfactory.c index 05a4f5d8e..dbb13cab8 100644 --- a/os/common/oslib/src/chfactory.c +++ b/os/common/oslib/src/chfactory.c @@ -135,6 +135,8 @@ 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;
@@ -142,6 +144,7 @@ static dyn_element_t *dyn_create_object_heap(const char *name, /* Initializing object list element.*/
strncpy(dep->name, name, CH_CFG_FACTORY_MAX_NAMES_LENGTH);
+ /*lint -restore*/
dep->refs = (ucnt_t)1;
dep->next = dlp->next;
@@ -187,7 +190,10 @@ 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*/
dep->refs = (ucnt_t)1;
dep->next = dlp->next;
|