From b4dde0d786e73cea46a49965fcb25333edc7abee Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Sat, 10 Feb 2018 10:10:57 +0000 Subject: MISRA-related changes. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@11470 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/common/oslib/src/chfactory.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'os/common/oslib/src/chfactory.c') 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; -- cgit v1.2.3