Skip to content
New issue

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

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

Already on GitHub? # to your account

Fix #31, reformat bracketed block #340

Merged
merged 1 commit into from
Dec 7, 2022
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
35 changes: 17 additions & 18 deletions fsw/src/cf_cfdp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1374,7 +1374,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 @@ -1394,27 +1395,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