kfsw-services/src/parameter/libparam_compat.c
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | #include <stddef.h> | ||
| 2 | |||
| 3 | 402 | size_t kfsw_libparam_strlcpy(char *destination, const char *source, size_t destination_size) | |
| 4 | { | ||
| 5 | 402 | const char *cursor = source; | |
| 6 | 402 | size_t copied = 0U; | |
| 7 | |||
| 8 | 402 | if (destination_size != 0U) { | |
| 9 | 536 | while ((copied + 1U < destination_size) && (*cursor != '\0')) { | |
| 10 | 134 | destination[copied++] = *cursor++; | |
| 11 | } | ||
| 12 | 402 | destination[copied] = '\0'; | |
| 13 | } | ||
| 14 | |||
| 15 | 402 | while (*cursor != '\0') { | |
| 16 | ✗ | cursor++; | |
| 17 | } | ||
| 18 | |||
| 19 | 402 | return (size_t)(cursor - source); | |
| 20 | } | ||
| 21 |