| 83 | } |
| 84 | |
| 85 | size_t strlcpy(char* dst, size_t dstSize, const char* src) |
| 86 | { |
| 87 | size_t i = 0; |
| 88 | if(dst && dstSize) |
| 89 | { |
| 90 | for(; i + 1 < dstSize && src[i]; i++) // copy up to dstSize-1 bytes |
| 91 | dst[i] = src[i]; |
| 92 | dst[i] = 0; // always null-terminate |
| 93 | } |
| 94 | |
| 95 | while(src[i]) // read any remaining characters in the src string to get the length |
| 96 | i++; |
| 97 | |
| 98 | return i; |
| 99 | } |
| 100 | |
| 101 | size_t strlcat(char* dst, size_t dstSize, const char* src) |
| 102 | { |
no outgoing calls
no test coverage detected