use the correct read count when determining how swabbing is necessary.
authortedu <tedu@openbsd.org>
Mon, 5 Jan 2015 13:52:47 +0000 (13:52 +0000)
committertedu <tedu@openbsd.org>
Mon, 5 Jan 2015 13:52:47 +0000 (13:52 +0000)
bug report from Martin Wolters

bin/dd/dd.c

index 6be77e1..23f9608 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: dd.c,v 1.19 2014/12/11 20:39:06 tedu Exp $    */
+/*     $OpenBSD: dd.c,v 1.20 2015/01/05 13:52:47 tedu Exp $    */
 /*     $NetBSD: dd.c,v 1.6 1996/02/20 19:29:06 jtc Exp $       */
 
 /*-
@@ -304,7 +304,7 @@ dd_in(void)
                }
 
                if (ddflags & C_SWAB) {
-                       if ((n = in.dbcnt) & 1) {
+                       if ((n = in.dbrcnt) & 1) {
                                ++st.swab;
                                --n;
                        }