]> diplodocus.org Git - nmh/blobdiff - sbr/cpydgst.c
Fix invalid pointer arithmetic.
[nmh] / sbr / cpydgst.c
index a1a887afe875f13af1f084306810430a81c1e95e..7d33cf476fe74b0c5aebfdb4b3fb616a8c679aed 100644 (file)
@@ -1,10 +1,6 @@
-
-/*
- * cpydgst.c -- copy from one fd to another in encapsulating mode
+/* cpydgst.c -- copy from one fd to another in encapsulating mode
  *           -- (do dashstuffing of input data).
  *
- * $Id$
- *
  * This code is Copyright (c) 2002, by the authors of nmh.  See the
  * COPYRIGHT file in the root directory of the nmh distribution for
  * complete copyright information.
@@ -37,9 +33,9 @@
 void
 cpydgst (int in, int out, char *ifile, char *ofile)
 {
-    register int i, j, state;
-    register char *cp, *ep;
-    register char *bp, *dp;
+    int i, j, state;
+    char *cp, *ep;
+    char *bp, *dp;
     char buffer[BUFSIZ], outbuf[BUFSIZ];
 
     dp = (bp = outbuf) + sizeof outbuf;
@@ -53,8 +49,8 @@ cpydgst (int in, int out, char *ifile, char *ofile)
                        output ('-');
                        output (' ');
                    }
-                   state = S2; /* fall */
-
+                   state = S2;
+                   /* FALLTHRU */
                case S2: 
                    output (*cp);
                    if (*cp == '\n')