Skip to content

Commit

Permalink
Changing comment to explain operation, word swap in MISRA.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Soren Ptak committed Aug 30, 2022
1 parent 8e8f9f4 commit d81fdb5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion MISRA.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion source/core_http_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -575,14 +575,15 @@ 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++ )
{
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;
Expand Down

0 comments on commit d81fdb5

Please sign in to comment.