| 17 | |
| 18 | #ifndef CRAWL_HAVE_STRLCPY |
| 19 | size_t strlcpy(char *dst, const char *src, size_t n) |
| 20 | { |
| 21 | if (!n) |
| 22 | return strlen(src); |
| 23 | |
| 24 | const char *s = src; |
| 25 | |
| 26 | while (--n > 0) |
| 27 | if (!(*dst++ = *s++)) |
| 28 | break; |
| 29 | |
| 30 | if (!n) |
| 31 | { |
| 32 | *dst++ = 0; |
| 33 | while (*s++) |
| 34 | ; |
| 35 | } |
| 36 | |
| 37 | return s - src - 1; |
| 38 | } |
| 39 | #endif |
| 40 | |
| 41 |
no outgoing calls
no test coverage detected