Skip to content

Commit

Permalink
Fix nasa#782, Initialize locals flagged in static analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
skliper committed Feb 9, 2021
1 parent 09a2c5e commit f1dc67d
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/os/shared/src/osapi-idmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@ int32 OS_ObjectIdFindNextFree(OS_object_token_t *token)
{
uint32 max_id;
uint32 base_id;
uint32 local_id;
uint32 local_id = 0;
uint32 serial;
uint32 i;
int32 return_code;
Expand Down
4 changes: 2 additions & 2 deletions src/unit-tests/osfile-test/ut_osfile_dirio_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ void UT_os_closedir_test()
**--------------------------------------------------------------------------------*/
void UT_os_readdir_test()
{
osal_id_t dirh;
osal_id_t dirh = 0;
const char *testDesc;

strcpy(g_subdirNames[0], " ");
Expand Down Expand Up @@ -566,7 +566,7 @@ void UT_os_readdir_test()
**--------------------------------------------------------------------------------*/
void UT_os_rewinddir_test()
{
osal_id_t dirh;
osal_id_t dirh = 0;
const char *testDesc;

strcpy(g_subdirNames[0], " ");
Expand Down
2 changes: 1 addition & 1 deletion src/ut-stubs/osapi-utstub-bsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ uint32 OS_BSP_GetArgC(void)
------------------------------------------------------------------*/
char *const *OS_BSP_GetArgV(void)
{
void *buffer;
void *buffer = NULL;
int32 status;

status = UT_DEFAULT_IMPL(OS_BSP_GetArgV);
Expand Down
2 changes: 1 addition & 1 deletion src/ut-stubs/osapi-utstub-idmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ OS_common_record_t *OS_ObjectIdGlobalFromToken(const OS_object_token_t *token)
{
static OS_common_record_t fake_record;
int32 status;
OS_common_record_t * recptr;
OS_common_record_t * recptr = &fake_record;

status = UT_DEFAULT_IMPL(OS_ObjectIdGlobalFromToken);
if (status == 0 &&
Expand Down

0 comments on commit f1dc67d

Please sign in to comment.