amount of data and decrease SKIP. Increment *TOTAL by the amount
of data written. If OUT2 is not NULL, also write BUF to OUT2.
In case of error writing to OUT, -1 is returned. In case of error
- writing to OUT2, -2 is returned. In case of any other error,
- 1 is returned. */
+ writing to OUT2, -2 is returned. Return 1 if the whole BUF was
+ skipped. */
static int
write_data (FILE *out, FILE *out2, const char *buf, int bufsize,
{
sum_read += ret;
int write_res = write_data (out, out2, dlbuf, ret, &skip, &sum_written);
- if (write_res != 0)
+ if (write_res < 0)
{
ret = (write_res == -3) ? -3 : -2;
goto out;
e.g. "1022", "247", "12.5", "2.38". */
sprintf (res, "%.*f %s",
dlrate >= 99.95 ? 0 : dlrate >= 9.995 ? 1 : 2,
- dlrate, !opt.bits_fmt? rate_names[units]: rate_names_bits[units]);
+ dlrate, !opt.report_bps ? rate_names[units]: rate_names_bits[units]);
return res;
}
double dlrate;
double bibyte = 1000.0;
- if (!opt.bits_fmt)
+ if (!opt.report_bps)
bibyte = 1024.0;