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 #2172, Remove last few uses of sprintf() #2173

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

thnkslprpt
Copy link
Contributor

@thnkslprpt thnkslprpt commented Oct 18, 2022

Checklist

Describe the contribution

2 other cases already have their own issues open with further changes being considered, and have not been updated with this PR at this stage (#1465 and #1511).

Testing performed
Standard cFS build tests (covered the fsw change but not test code change).

Expected behavior changes
No impact on behavior expected.

System(s) tested on
Intel(R) Celeron(R) N4100 CPU @ 1.10GHz x86_64
Debian GNU/Linux 11 (bullseye)
cFE v7.0.0-rc4+dev193

Contributor Info
Avi Weiss @thnkslprpt

@dzbaker
Copy link
Collaborator

dzbaker commented Oct 20, 2022

@thnkslprpt Do you know why the Functional Test check is failing?

@thnkslprpt
Copy link
Contributor Author

@thnkslprpt Do you know why the Functional Test check is failing?

Will figure it out and get back to you.

@thnkslprpt thnkslprpt marked this pull request as draft October 21, 2022 02:06
@thnkslprpt
Copy link
Contributor Author

thnkslprpt commented Oct 21, 2022

@thnkslprpt Do you know why the Functional Test check is failing?

OK it seems to be passing now.
The 2nd parameter (bufsz) of snprintf() was decaying to a pointer causing the function to print an empty string.
By using CFE_MISSION_ES_CDS_MAX_FULL_NAME_LEN as the bufsz parameter, which is the size of the passed-in FullCDSName for the CFE_ES_FormCDSName() fuction, the snprintf() functions correctly.

Ref for size of FullCDSName parameter:

** \param[in, out] FullCDSName pointer to character buffer of #CFE_MISSION_ES_CDS_MAX_FULL_NAME_LEN size

@thnkslprpt thnkslprpt marked this pull request as ready for review October 21, 2022 02:35
modules/es/fsw/src/cfe_es_cds.c Outdated Show resolved Hide resolved
Copy link
Contributor

@jphickey jphickey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is good, however we should also not forget about the other one (as noted, my suggestion is to remove the broken API, clean up the caller).

@thnkslprpt
Copy link
Contributor Author

This change is good, however we should also not forget about the other one (as noted, my suggestion is to remove the broken API, clean up the caller).

No worries Joe.
#2193

@jphickey jphickey added the CCB:Ready Ready for discussion at the Configuration Control Board (CCB) label Feb 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CCB:Ready Ready for discussion at the Configuration Control Board (CCB) enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove remaining stray uses of sprintf()
4 participants