Fix the pwd and group functions. The bb_ stuff was a leftover from
[oweals/busybox.git] / uuencode.c
index 41e6590756504b5e6855c869299b67cc070eaad3..5df49026b4f658e45d850efa179a3386c6ca769b 100644 (file)
@@ -27,7 +27,7 @@
 #include <stdio.h>
 #include <errno.h>
 #include <getopt.h>
-#include <pwd.h>
+#include <stdlib.h>
 
 #define        RW (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH)
 
@@ -160,15 +160,12 @@ int uuencode_main (int argc,
   trans_ptr = uu_std;      /* Standard encoding is old uu format */
 
   /* Parse any options */
-  while ((opt = getopt (argc, argv, "m")) != EOF) {
+  while ((opt = getopt (argc, argv, "m")) > 0) {
     switch (opt) {
      case 'm':
       trans_ptr = uu_base64;
       break;
 
-     case 0:
-      break;
-
      default:
       usage(uuencode_usage);
     }
@@ -178,7 +175,7 @@ int uuencode_main (int argc,
    case 2:
     /* Optional first argument is input file.  */
     if (!freopen (argv[optind], "r", stdin) || fstat (fileno (stdin), &sb)) {
-      error_msg("%s: %s\n", argv[optind], strerror(errno));
+      perror_msg("%s", argv[optind]);
       return EXIT_FAILURE;
     }
     mode = sb.st_mode & (S_IRWXU | S_IRWXG | S_IRWXO);