Skip to content

Commit

Permalink
Fix #17, add validation for rtncode and update bracket to standard
Browse files Browse the repository at this point in the history
  • Loading branch information
avan989 committed Oct 2, 2019
1 parent 538956f commit e888ec0
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions elf2cfetbl.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ CFE_TBL_File_Hdr_t TableHeader;

union Elf_Ehdr ElfHeader;
union Elf_Shdr **SectionHeaderPtrs = NULL;
union Elf_Shdr SectionHeaderStringTable = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
union Elf_Shdr SectionHeaderStringTable = {{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }};
int64 SectionHeaderStringTableDataOffset = 0;
char **SectionNamePtrs = NULL;

Expand Down Expand Up @@ -1367,11 +1367,18 @@ int32 OpenSrcFile(void)

/* Obtain time of object file's last modification */
RtnCode = stat(SrcFilename, &SrcFileStats);
if (RtnCode == 0)
{
SrcFileTimeInScEpoch = SrcFileStats.st_mtime + EpochDelta;

SrcFileTimeInScEpoch = SrcFileStats.st_mtime + EpochDelta;

if (Verbose) printf("Original Source File Modification Time: %s\n", ctime(&SrcFileStats.st_mtime));
if (Verbose) printf("Source File Modification Time in Seconds since S/C Epoch: %ld (0x%08lX)\n", SrcFileTimeInScEpoch, SrcFileTimeInScEpoch);
if (Verbose) printf("Original Source File Modification Time: %s\n", ctime(&SrcFileStats.st_mtime));
if (Verbose) printf("Source File Modification Time in Seconds since S/C Epoch: %ld (0x%08lX)\n", SrcFileTimeInScEpoch, SrcFileTimeInScEpoch);
}
else
{
if (Verbose) printf("Unable to get modification time from %s", SrcFilename);
SrcFileTimeInScEpoch = 0;
}

return SUCCESS;
}
Expand Down

0 comments on commit e888ec0

Please sign in to comment.