Skip to content

Commit

Permalink
Merge pull request #38 from skliper/fix36-redundant_length_check
Browse files Browse the repository at this point in the history
Fix #36, Remove redundant conditional to support full coverage
  • Loading branch information
astrogeco committed Jun 22, 2022
2 parents 4336824 + 14a4ef8 commit d2bffb4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fsw/src/fm_child.c
Original file line number Diff line number Diff line change
Expand Up @@ -1272,7 +1272,7 @@ void FM_ChildDirListPktCmd(const FM_ChildQueueEntry_t *CmdArgs)
EntryLength = strlen(OS_DIRENTRY_NAME(DirEntry));

/* Verify combined directory plus filename length */
if ((EntryLength < sizeof(ListEntry->EntryName)) && ((PathLength + EntryLength) < OS_MAX_PATH_LEN))
if ((PathLength + EntryLength) < OS_MAX_PATH_LEN)
{
/* Add filename to directory listing telemetry packet */
strncpy(ListEntry->EntryName, OS_DIRENTRY_NAME(DirEntry), EntryLength);
Expand All @@ -1282,7 +1282,7 @@ void FM_ChildDirListPktCmd(const FM_ChildQueueEntry_t *CmdArgs)
strncpy(LogicalName, CmdArgs->Source2, PathLength);
LogicalName[PathLength] = '\0';

strncat(LogicalName, OS_DIRENTRY_NAME(DirEntry), (OS_MAX_PATH_LEN - PathLength));
strncat(LogicalName, OS_DIRENTRY_NAME(DirEntry), EntryLength);

FM_ChildSleepStat(LogicalName, ListEntry, &FilesTillSleep, CmdArgs->GetSizeTimeMode);

Expand Down

0 comments on commit d2bffb4

Please sign in to comment.