MCPcopy Create free account
hub / github.com/coreutils/coreutils / repeat_pattern

Function repeat_pattern

src/yes.c:65–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63 doubling the copy size each iteration. DEST may equal SRC. */
64
65static void
66repeat_pattern (char *dest, char const *src, idx_t srcsize, idx_t bufsize)
67{
68 if (dest != src)
69 memcpy (dest, src, srcsize);
70 for (idx_t filled = srcsize; filled < bufsize; )
71 {
72 idx_t chunk = MIN (filled, bufsize - filled);
73 memcpy (dest + filled, dest, chunk);
74 filled += chunk;
75 }
76}
77
78#if HAVE_SPLICE
79

Callers 2

splice_writeFunction · 0.85
mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected