Fix up some silly macros and use xmalloc and friends exclusively.
[oweals/busybox.git] / uuencode.c
index 36bc4970f0a5bdaa1e7804a0dc174b4427b8e0c1..41541defbab71be322f221344e2c4b0f4d4c619e 100644 (file)
 /* Hacked to work with BusyBox by Alfred M. Szmidt */
 
 
-#include "busybox.h"
 
 #include <stdio.h>
 #include <errno.h>
 #include <getopt.h>
-#include <pwd.h>
+#include <stdlib.h>
+#include "busybox.h"
 
 #define        RW (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH)
 
@@ -142,7 +142,7 @@ static void encode()
   }
 
   if (ferror (stdin))
-    error_msg("Read error\n");
+    error_msg("Read error");
 
   if (trans_ptr == uu_std) {
     putchar (ENC ('\0'));
@@ -167,7 +167,7 @@ int uuencode_main (int argc,
       break;
 
      default:
-      usage(uuencode_usage);
+      show_usage();
     }
   }
 
@@ -188,7 +188,7 @@ int uuencode_main (int argc,
 
    case 0:
    default:
-    usage(uuencode_usage);
+    show_usage();
   }
 
   printf("begin%s %o %s\n", trans_ptr == uu_std ? "" : "-base64",
@@ -196,7 +196,7 @@ int uuencode_main (int argc,
   encode();
   printf(trans_ptr == uu_std ? "end\n" : "====\n");
   if (ferror (stdout)) {
-    error_msg("Write error\n");
+    error_msg("Write error");
     return EXIT_FAILURE;
   }
   return EXIT_SUCCESS;