The function used an assert if n was 0. Instead
of using an assert, the function will now just
not do anything. The documentation has also
been updated to reflect this.
The reasoning for this is that the strlcpy function
this (sort of) implements for utf8 works the same way.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
In order to bring consistency in-tree, migrate all lib code to the new
prefix <zephyr/...>. Note that the conversion has been scripted, refer
to zephyrproject-rtos#45388 for more details.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Add a function to copy a UTF-8 encoded string that
ensure correct truncation of the string if the source
is larger than the destination, as well as ensuring that
the resulting destination string is NULL-terminated.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add a function that can properly truncate UTF-8 strings
without leaving unterminated started characters,
as UTF-8 characters can be 1-4 bytes long.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>