Skip to content

Commit

Permalink
Merge pull request #340 from havencarlson/fix#31
Browse files Browse the repository at this point in the history
Fix #31, reformat bracketed block
  • Loading branch information
dzbaker authored Dec 7, 2022
2 parents b9a8898 + d8a376b commit e1daebe
Showing 1 changed file with 17 additions and 18 deletions.
35 changes: 17 additions & 18 deletions fsw/src/cf_cfdp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1393,7 +1393,8 @@ int32 CF_CFDP_PlaybackDir(const char *src_filename, const char *dst_filename, CF
*-----------------------------------------------------------------*/
void CF_CFDP_ProcessPlaybackDirectory(CF_Channel_t *c, CF_Playback_t *p)
{
os_dirent_t dirent;
CF_Transaction_t *pt;
os_dirent_t dirent;
/* either there's no transaction (first one) or the last one was finished, so check for a new one */

memset(&dirent, 0, sizeof(dirent));
Expand All @@ -1413,27 +1414,25 @@ void CF_CFDP_ProcessPlaybackDirectory(CF_Channel_t *c, CF_Playback_t *p)
continue;
}

{
CF_Transaction_t *pt = CF_FindUnusedTransaction(c);
CF_Assert(pt); /* should be impossible not to have one because there are limits on the number of uses of
them */
pt = CF_FindUnusedTransaction(c);
CF_Assert(pt); /* should be impossible not to have one because there are limits on the number of uses of
them */

/* the -1 below is to make room for the slash */
snprintf(pt->history->fnames.src_filename, sizeof(pt->history->fnames.src_filename), "%.*s/%.*s",
CF_FILENAME_MAX_PATH - 1, p->fnames.src_filename, CF_FILENAME_MAX_NAME - 1, dirent.FileName);
snprintf(pt->history->fnames.dst_filename, sizeof(pt->history->fnames.dst_filename), "%.*s/%.*s",
CF_FILENAME_MAX_PATH - 1, p->fnames.dst_filename, CF_FILENAME_MAX_NAME - 1, dirent.FileName);
/* the -1 below is to make room for the slash */
snprintf(pt->history->fnames.src_filename, sizeof(pt->history->fnames.src_filename), "%.*s/%.*s",
CF_FILENAME_MAX_PATH - 1, p->fnames.src_filename, CF_FILENAME_MAX_NAME - 1, dirent.FileName);
snprintf(pt->history->fnames.dst_filename, sizeof(pt->history->fnames.dst_filename), "%.*s/%.*s",
CF_FILENAME_MAX_PATH - 1, p->fnames.dst_filename, CF_FILENAME_MAX_NAME - 1, dirent.FileName);

/* in case snprintf didn't have room for NULL terminator */
pt->history->fnames.src_filename[CF_FILENAME_MAX_LEN - 1] = 0;
pt->history->fnames.dst_filename[CF_FILENAME_MAX_LEN - 1] = 0;
/* in case snprintf didn't have room for NULL terminator */
pt->history->fnames.src_filename[CF_FILENAME_MAX_LEN - 1] = 0;
pt->history->fnames.dst_filename[CF_FILENAME_MAX_LEN - 1] = 0;

CF_CFDP_TxFile_Initiate(pt, p->cfdp_class, p->keep, (c - CF_AppData.engine.channels), p->priority,
p->dest_id);
CF_CFDP_TxFile_Initiate(pt, p->cfdp_class, p->keep, (c - CF_AppData.engine.channels), p->priority,
p->dest_id);

pt->p = p;
++p->num_ts;
}
pt->p = p;
++p->num_ts;
}
else
{
Expand Down

0 comments on commit e1daebe

Please # to comment.