Skip to content

Fix #2638, Use unsigned format specifier for perf marker log#2682

Open
heathdutton wants to merge 1 commit intonasa:mainfrom
heathdutton:fix-2638-perf-marker-format-specifier
Open

Fix #2638, Use unsigned format specifier for perf marker log#2682
heathdutton wants to merge 1 commit intonasa:mainfrom
heathdutton:fix-2638-perf-marker-format-specifier

Conversation

@heathdutton
Copy link

Checklist (Please check before submitting)

Describe the contribution
Fixes #2638

The CFE_ES_WriteToSysLog call in CFE_ES_PerfLogAdd uses %d to format Marker (which is uint32, cast to unsigned int) and CFE_MISSION_ES_PERF_MAX_IDS - 1. Changed both format specifiers to %u so the format string matches the actual argument types.

Testing performed
Code review. Verified the existing unit test in es_UT.c covers the invalid marker path and does not assert on message text, so no test changes needed.

Expected behavior changes
Marker values with bit 31 set will now print as the correct unsigned value instead of a misleading negative number. No other behavior change.

System(s) tested on
Code review only (macOS does not support cFS native build)

Contributor Info
Heath Dutton

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implicit type conversion in CFE_ES_PerfLogAdd())

1 participant