MCPcopy Create free account
hub / github.com/crawl/crawl / strlcpy

Function strlcpy

crawl-ref/source/stringutil.cc:19–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17
18#ifndef CRAWL_HAVE_STRLCPY
19size_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

Callers 4

_rune_from_specsFunction · 0.85
debug_item_scanFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected