| 398 | and exit immediately upon error. */ |
| 399 | |
| 400 | static void |
| 401 | write_bytes (char const *buf, size_t n_bytes) |
| 402 | { |
| 403 | if (n_bytes <= SMALL_BYTE_THRESHOLD) |
| 404 | { |
| 405 | for (size_t i = 0; i < n_bytes; i++) |
| 406 | if (putchar (buf[i]) < 0) |
| 407 | write_error (); |
| 408 | return; |
| 409 | } |
| 410 | |
| 411 | if (fwrite (buf, sizeof (char), n_bytes, stdout) != n_bytes) |
| 412 | write_error (); |
| 413 | } |
| 414 | |
| 415 | /* Like memcpy, but avoid a function call for smaller amounts. */ |
| 416 |
no test coverage detected