Skip to content

Commit

Permalink
Conform to clang-style
Browse files Browse the repository at this point in the history
  • Loading branch information
martintc committed Nov 4, 2021
1 parent ed2c0cb commit 5962ec8
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions ut_assert/src/uttools.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,18 @@ bool UtMem2BinFile(const void *Memory, const char *Filename, uint32 Length)
FILE * fp;
struct stat dststat;

if ((fp = fopen(Filename, "w"))) {
if ((fp = fopen(Filename, "w")))
{
int fd = fileno(fp);
fstat(fd, &dststat);
if ((fchmod(fd, dststat.st_mode & ~(S_IRGRP | S_IWGRP | S_IXGRP | S_IROTH | S_IWOTH | S_IXOTH)) == 0))
{
fwrite(Memory, Length, 1, fp);
fclose(fp);
return (true);
} else {
}
else
{
printf("Unable to limit permissions on file");
fclose(fp);
return (false);
Expand Down Expand Up @@ -139,7 +142,9 @@ bool UtMem2HexFile(const void *Memory, const char *Filename, uint32 Length)
}
fclose(fp);
return (true);
} else {
}
else
{
printf("Unable to limit permissions on file\n");
fclose(fp);
return (false);
Expand Down

0 comments on commit 5962ec8

Please sign in to comment.