MCPcopy Create free account
hub / github.com/apache/trafficserver / ink_strlcat

Function ink_strlcat

src/tscore/ink_string.cc:204–232  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

202
203#if !HAVE_STRLCAT
204size_t
205ink_strlcat(char *dst, const char *src, size_t siz)
206{
207 char *d = dst;
208 const char *s = src;
209 size_t n = siz;
210 size_t dlen;
211
212 /* Find the end of dst and adjust bytes left but don't go past end */
213 while (n-- != 0 && *d != '\0') {
214 d++;
215 }
216 dlen = d - dst;
217 n = siz - dlen;
218
219 if (n == 0) {
220 return (dlen + strlen(s));
221 }
222 while (*s != '\0') {
223 if (n != 1) {
224 *d++ = *s;
225 n--;
226 }
227 s++;
228 }
229 *d = '\0';
230
231 return (dlen + (s - src)); /* count does not include NUL */
232}
233#endif

Callers 10

start_internalMethod · 0.85
make_url_for_getFunction · 0.85
setMethod · 0.85
appendMethod · 0.85
setupMethod · 0.85
prepareFunction · 0.85
SECTIONFunction · 0.85
TSstrlcatFunction · 0.85

Calls

no outgoing calls

Tested by 3

prepareFunction · 0.68
SECTIONFunction · 0.68