Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #17, add validation for rtncode and update bracket to standard #20

Merged
merged 1 commit into from
Oct 23, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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