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

Function copy_simple

src/dd.c:1951–1969  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1949/* Copy NREAD bytes of BUF, with no conversions. */
1950
1951static void
1952copy_simple (char const *buf, idx_t nread)
1953{
1954 char const *start = buf; /* First uncopied char in BUF. */
1955
1956 do
1957 {
1958 idx_t nfree = MIN (nread, output_blocksize - oc);
1959
1960 memcpy (obuf + oc, start, nfree);
1961
1962 nread -= nfree; /* Update the number of bytes left to copy. */
1963 start += nfree;
1964 oc += nfree;
1965 if (oc >= output_blocksize)
1966 write_output ();
1967 }
1968 while (nread != 0);
1969}
1970
1971/* Copy NREAD bytes of BUF, doing conv=block
1972 (pad newline-terminated records to 'conversion_blocksize',

Callers 1

dd_copyFunction · 0.85

Calls 1

write_outputFunction · 0.85

Tested by

no test coverage detected