Output the Result Lines
Output the Result Lines

Write the results to the output file.

Notes
The write_bytes() routine is used for two different functions. It's most common use is to generate the output from a sort operation. It is also (coincidentally?) used when copying bytes during overwrite protection support.

Define write_bytes()
Function definition

Wraps and standardizes file output.
Segment Source
 388: static void
 389: write_bytes (const char *buf, size_t n_bytes, FILE *fp)
 390: {
 391:   if (fwrite (buf, 1, n_bytes, fp) != n_bytes)
 392:     {
 393:       error (0, errno, _("write error"));
 394:       cleanup ();
 395:       exit (SORT_FAILURE);
 396:     }
 397: }
 398: 

Duplicate potentially overwriten files
Code insertion

Write the bytes from a potentially overwritten file to a temporary file for further processing.
Segment Source
2108:                 write_bytes (buf, cc, ofp);