Use BB_FEATURE_CLEAN_UP where appropriate
[oweals/busybox.git] / uudecode.c
index 752497cb093641fdaff9decf7dce3779cac5ebb4..90bef9238f103c885ad85e446fa12ee54f761d5c 100644 (file)
@@ -55,6 +55,7 @@
 
 #include <stdio.h>
 #include <errno.h>
+#include <getopt.h>
 #include <pwd.h>
 
 /*struct passwd *getpwnam();*/
@@ -285,7 +286,7 @@ static int decode (const char *inname,
       && (freopen (outname, "w", stdout) == NULL
          || chmod (outname, mode & (S_IRWXU | S_IRWXG | S_IRWXO))
          )) {
-    errorMsg("uudeoce %s: %s %s\n", outname, inname, strerror(errno)); /* */
+    errorMsg("%s: %s %s\n", outname, inname, strerror(errno)); /* */
     return FALSE;
   }
 
@@ -299,15 +300,6 @@ static int decode (const char *inname,
     return read_stduu (inname);
 }
 
-static const char uudecode_usage[] =
-    "uudecode [FILE]...\n"
-#ifndef BB_FEATURE_TRIVIAL_HELP
-    "\nUudecode a file that is uuencoded.\n\n"
-    "Options:\n"
-    "\t-o FILE\tdirect output to FILE\n"
-#endif
-;
-
 int uudecode_main (int argc,
                    char **argv)
 {
@@ -339,7 +331,7 @@ int uudecode_main (int argc,
         if (decode (argv[optind], outname) != 0)
           exit_status = FALSE;
       } else {
-        errorMsg("uudecode: %s: %s\n", argv[optind], strerror(errno));
+        errorMsg("%s: %s\n", argv[optind], strerror(errno));
         exit_status = FALSE;
       }
       optind++;