From a7db955e75096e411c52b1ddc736b22f5c079121 Mon Sep 17 00:00:00 2001 From: Keith Bostic Date: Sat, 27 Jul 1991 20:40:29 -0800 Subject: [PATCH] don't bzero/memset twice, already done before the read SCCS-vsn: bin/dd/dd.c 5.7 --- usr/src/bin/dd/dd.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/usr/src/bin/dd/dd.c b/usr/src/bin/dd/dd.c index f5a43ac295..82d595d25b 100644 --- a/usr/src/bin/dd/dd.c +++ b/usr/src/bin/dd/dd.c @@ -16,7 +16,7 @@ char copyright[] = #endif /* not lint */ #ifndef lint -static char sccsid[] = "@(#)dd.c 5.6 (Berkeley) %G%"; +static char sccsid[] = "@(#)dd.c 5.7 (Berkeley) %G%"; #endif /* not lint */ #include @@ -246,11 +246,10 @@ dd_in() /* Handle partial input blocks. */ } else if (n != in.dbsz) { - /* If sync, fill the block with NULs. */ - if (ddflags & C_SYNC) { - bzero(in.dbp + n, in.dbsz - n); + /* If sync, use the entire block. */ + if (ddflags & C_SYNC) in.dbcnt += in.dbrcnt = in.dbsz; - } else + else in.dbcnt += in.dbrcnt = n; ++in.p_stats; } -- 2.20.1