* Copyright (c) 1991 The Regents of the University of California.
* This code is derived from software contributed to Berkeley by
* Keith Muller of the University of California, San Diego and Lance
* Visser of Convex Computer Corporation.
* %sccs.include.redist.c%
static char sccsid
[] = "@(#)misc.c 5.3 (Berkeley) %G%";
/* Use snprintf(3) so that we don't reenter stdio(3). */
len
= snprintf(buf
, sizeof(buf
),
"%u+%u records in\n%u+%u records out\n",
st
.in_full
, st
.in_part
, st
.out_full
, st
.out_part
);
(void)write(STDERR_FILENO
, buf
, len
);
len
= snprintf(buf
, sizeof(buf
), "%u odd length swab %s\n",
st
.swab
, (st
.swab
== 1) ? "block" : "blocks");
(void)write(STDERR_FILENO
, buf
, len
);
len
= snprintf(buf
, sizeof(buf
), "%u truncated %s\n",
st
.trunc
, (st
.trunc
== 1) ? "block" : "blocks");
(void)write(STDERR_FILENO
, buf
, len
);
err(const char *fmt
, ...)
(void)fprintf(stderr
, "dd: ");
(void)vfprintf(stderr
, fmt
, ap
);
(void)fprintf(stderr
, "\n");
warn(const char *fmt
, ...)
(void)fprintf(stderr
, "dd: ");
(void)vfprintf(stderr
, fmt
, ap
);
(void)fprintf(stderr
, "\n");