MCPcopy Create free account
hub / github.com/Meituan-Dianping/SQLAdvisor / strlcat

Function strlcat

mysys_ssl/crypt_genhash_impl.cc:90–115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88*/
89
90size_t
91strlcat(char *dst, const char *src, size_t siz)
92{
93 char *d= dst;
94 const char *s= src;
95 size_t n= siz;
96 size_t dlen;
97 /* Find the end of dst and adjust bytes left but don't go past end */
98 while (n-- != 0 && *d != '\0')
99 d++;
100 dlen= d - dst;
101 n= siz - dlen;
102 if (n == 0)
103 return(dlen + siz);
104 while (*s != '\0')
105 {
106 if (n != 1)
107 {
108 *d++= *s;
109 n--;
110 }
111 s++;
112 }
113 *d= '\0';
114 return(dlen + (s - src)); /* count does not include NUL */
115}
116
117static const int crypt_alg_magic_len = sizeof (crypt_alg_magic) - 1;
118

Callers 1

my_crypt_genhashFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected