Changed count value in strncpy function. Instead of using a source's size, there is used a max size of destination string. If the source's size is shorter than count, the strncpy will add a null character to the destination string.
Motivation and Context
The following change removes warnings which appear in gcc version > 9.
Types of changes
[x] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to change)
How Has This Been Tested?
[ ] Already covered by automatic testing.
[ ] New test added: (add PR link here).
[ ] Tested by hand on: (list targets here).
Checklist:
[ ] My change requires a change to the documentation.
[ ] I have updated the documentation accordingly.
[ ] I have added tests to cover my changes.
[ ] All new and existing linter checks and tests passed.
[x] My changes generate no new compilation warnings for any of the targets.
Special treatment
[ ] This PR needs additional PRs to work (list the PRs, preferably in merge-order).
[x] I will merge this PR by myself when appropriate.
JIRA: RTOS-61
Description
Changed
count
value instrncpy
function. Instead of using a source's size, there is used a max size of destination string. If the source's size is shorter thancount
, thestrncpy
will add a null character to the destination string.Motivation and Context
The following change removes warnings which appear in gcc version > 9.
Types of changes
How Has This Been Tested?
Checklist:
Special treatment