zephyr: Add zero-len check for utf8_trunc

The function did not check if the provided string had a zero
length before starting to truncate, which meant that last_byte_p
could possible have pointed to the value before the string.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
1 file changed