ot::StringCopy() function
Copies a string into a given target buffer with a given size if it fits.
Arguments
aTargetSize
The size (number of characters) in @p aTargetBuffer array.
aSource
A pointer to null-terminated string to copy from. Can be `nullptr` which treated as "".
aEncodingCheck
Specifies the encoding format check (e.g., UTF-8) to perform.
Return value
kErrorNone The @p aSource fits in the given buffer. @p aTargetBuffer is updated. kErrorInvalidArgs The @p aSource does not fit in the given buffer. kErrorParse The @p aSource does not follow the encoding format specified by @p aEncodingCheck.
![]()
Error StringCopy(char (&aTargetBuffer)[kSize],
ot::StringCopy() calls 2 functions:
![]()
ot::StringCopy()
ot::StringCopy() reads 6 variables:
![]()
ot::StringCopy()