Skip to content

Commit

Permalink
Incorporate PR #112 feedback
Browse files Browse the repository at this point in the history
- Move `DirName` directory to beginning of function
- Remove redundant `sizeof(char)`
  • Loading branch information
irowebbn authored Nov 30, 2023
1 parent 0bedf4c commit 5ca72f0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions unit-test/ds_file_tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -960,12 +960,12 @@ void DS_FileCloseDest_Test_PlatformConfigMoveFiles_MoveError(void)
void DS_FileCloseDest_Test_PlatformConfigMoveFiles_FilenameTooLarge(void)
{
int32 FileIndex = 0;

const char DirName[] = "directory1/";

/* Set up the handle */
OS_OpenCreate(&DS_AppData.FileStatus[FileIndex].FileHandle, NULL, 0, 0);

const char DirName[] = "directory1/";
size_t DirNameLen = sizeof(DirName)/sizeof(char);

size_t DirNameLen = sizeof(DirName);
strncpy(DS_AppData.FileStatus[FileIndex].FileName, DirName, DirNameLen);
memset(&DS_AppData.FileStatus[FileIndex].FileName[DirNameLen-1], 'f', DS_TOTAL_FNAME_BUFSIZE - DirNameLen);
DS_AppData.FileStatus[FileIndex].FileName[DS_TOTAL_FNAME_BUFSIZE-1] = '\0';
Expand Down

0 comments on commit 5ca72f0

Please sign in to comment.