From d81fdb5ca995b40eccb50ec832fa0865863a8ffe Mon Sep 17 00:00:00 2001 From: Soren Ptak Date: Tue, 30 Aug 2022 21:44:25 +0000 Subject: [PATCH] Changing comment to explain operation, word swap in MISRA.md --- MISRA.md | 2 +- source/core_http_client.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/MISRA.md b/MISRA.md index 49fd1208..296b961f 100644 --- a/MISRA.md +++ b/MISRA.md @@ -7,7 +7,7 @@ The specific deviations, suppressed inline, are listed below. Additionally, [MISRA configuration file](https://github.com/FreeRTOS/coreHTTP/blob/main/tools/coverity/misra.config) contains the project wide deviations. ### Suppressed with Coverity Comments -To find the violation references in the source files run grep on the source code +To find the deviation references in the source files run grep on the source code with ( Assuming rule 5.4 violation; with justification in point 2 ): ``` grep 'MISRA Ref 5.4.2' . -rI diff --git a/source/core_http_client.c b/source/core_http_client.c index 6a831b74..a2b09963 100644 --- a/source/core_http_client.c +++ b/source/core_http_client.c @@ -575,6 +575,7 @@ static int8_t caseInsensitiveStringCmp( const char * str1, /* Inclusion of inbetween variables for MISRA rule 13.2 compliance */ char firstChar; char secondChar; + /* Get the offset from a lowercase to capital character in a MISRA compliant way */ int8_t offset = 'a' - 'A'; for( i = 0U; i < n; i++ ) @@ -582,7 +583,7 @@ static int8_t caseInsensitiveStringCmp( const char * str1, firstChar = str1[ i ]; secondChar = str2[ i ]; - /* Subtract 32 to go from lowercase to uppercase ASCII character */ + /* Subtract offset to go from lowercase to uppercase ASCII character */ if( ( firstChar >= 'a' ) && ( firstChar <= 'z' ) ) { firstChar = firstChar - offset;