Misleading command code comment in `FM_ChildFileInfoCmd

Open Beginner friendly
#130 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
92/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Quiet
Tech stack
c
Domain
documentation

Research direction

Open fsw/src/fm_child.c around line 789 and inspect the FM_ChildFileInfoCmd comment alongside the command handler. Change the documented command code to FM_GET_FILE_INFO_CC, then review the surrounding comment to confirm it describes Get File Info without changing runtime code.

Written by the indexing model from the issue text.

Description

enhancement

Description

In the function FM_ChildFileInfoCmd, the comment describing the command arguments contains an incorrect command code reference:
https://github.com/nasa/FM/blob/558a7763027dd6d495a603624e7dd6b35f9952ac/fsw/src/fm_child.c#L789

/*
** Command argument usage for this command:
**
**  CmdArgs->CommandCode   = FM_GET_DIR_LIST_FILE_CC
**  CmdArgs->Source1       = name of directory or file
**  CmdArgs->FileInfoState = state of directory or file
**  CmdArgs->FileInfoSize  = file size, else zero
**  CmdArgs->FileInfoTime  = last modify time
*/

However, this function handles the Get File Info command, and the correct command code should be:

FM_GET_FILE_INFO_CC

Issue

The current comment is misleading because:

  • FM_GET_DIR_LIST_FILE_CC refers to a different command (directory listing context)
  • This can confuse developers trying to understand or maintain the code
  • It may lead to incorrect assumptions when tracing command handling

Suggested Fix

Update the comment to:

CmdArgs->CommandCode   = FM_GET_FILE_INFO_CC

Impact

This is a documentation/comment issue only and does not affect runtime behavior.

Dominant language
C
Stars
45
Forks
39
Avg merge
4d 10h
Merged PRs (30d)
2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from nasa/FM

All issues in nasa/FM

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.