Grammer and layout fixes anno.man1
[mmh] / sbr / cpydgst.c
index 86211cf..5e5ef87 100644 (file)
@@ -7,6 +7,8 @@
 ** complete copyright information.
 */
 
+#include <sysexits.h>
+#include <unistd.h>
 #include <h/mh.h>
 
 /*
@@ -26,7 +28,7 @@
 
 #define output(c)  if (bp >= dp) {flush(); *bp++ = c;} else *bp++ = c
 #define flush()  if ((j = bp - outbuf) && write(out, outbuf, j) != j) \
-               adios(ofile, "error writing"); \
+               adios(EX_IOERR, ofile, "error writing"); \
        else \
                bp = outbuf
 
@@ -34,9 +36,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;
@@ -45,22 +47,22 @@ cpydgst(int in, int out, char *ifile, char *ofile)
                        if (*cp == '\0')
                                continue;
                        switch (state) {
-                               case S1:
-                                       if (*cp == '-') {
-                                               output('-');
-                                               output(' ');
-                                       }
-                                       state = S2;  /* fall */
+                       case S1:
+                               if (*cp == '-') {
+                                       output('-');
+                                       output(' ');
+                               }
+                               state = S2;  /* fall */
 
-                               case S2:
-                                       output(*cp);
-                                       if (*cp == '\n')
-                                               state = S1;
-                                       break;
+                       case S2:
+                               output(*cp);
+                               if (*cp == '\n')
+                                       state = S1;
+                               break;
                        }
                }
 
        if (i == -1)
-               adios(ifile, "error reading");
+               adios(EX_IOERR, ifile, "error reading");
        flush();
 }