That's an embarrassing bug!  Thanks for reporting it.  I installed
this patch into CVS coreutils (main branch).

We should add a test case but I'm not offhand sure which file it
should go into.  Jim, advice?

2005-10-31  Paul Eggert  <[EMAIL PROTECTED]>

        * src/dd.c (skip): Fix off-by-one error reported by
        Theodoros V. Kalamatianos.

--- src/dd.c    30 Sep 2005 05:07:11 -0000      1.188
+++ src/dd.c    31 Oct 2005 08:39:14 -0000      1.189
@@ -1167,7 +1167,7 @@ skip (int fdesc, char const *file, uintm
          if (fdesc == STDIN_FILENO)
            advance_input_offset (nread);
        }
-      while (records-- != 0);
+      while (--records != 0);
 
       return records;
     }


_______________________________________________
Bug-coreutils mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to