Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
21.18 is a safe strncpy function call non-compliant?
#3
The amplification of Rule 21.18 states that the size parameter shall be no greater than the size of the smallest object passed to the function through a pointer parameter.

In your example, the smallest object is six characters - therefore passing a size of 128 is non-compliant with the Rule.
Posted by and on behalf of the MISRA C Working Group
Reply


Messages In This Thread
RE: 21.18 is a safe strncpy function call non-compliant? - by misra-c - 20-11-2025, 12:46 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)