Ahem: add new faq entry to list at top of FAQ.html
[oweals/busybox.git] / archival / bunzip2.c
index e2c3ca91dd7674bbac79655647903c26deb69d24..5cd013c0ce87d72948caa915f2b1d60eedbb4d5a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Modified for busybox by Glenn McGrath <bug1@optushome.com.au>
+ *  Modified for busybox by Glenn McGrath <bug1@iinet.net.au>
  *  Added support output to stdout by Thomas Lundquist <thomasez@zelow.no>
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -33,6 +33,9 @@
 int bunzip2_main(int argc, char **argv)
 {
        char *compressed_name;
+       /* Note: Ignore the warning about save_name being used uninitialized.
+        * That is not the case, but gcc has trouble working that out... */
+#warning The save_name warning is OK, ignore it
        char *save_name;
        unsigned long opt;
        int status;
@@ -52,7 +55,7 @@ int bunzip2_main(int argc, char **argv)
                /* Open input file */
                src_fd = bb_xopen(compressed_name, O_RDONLY);
        } else {
-               src_fd = fileno(stdin);
+               src_fd = STDIN_FILENO;
                opt |= BUNZIP2_OPT_STDOUT;
        }
 
@@ -62,7 +65,7 @@ int bunzip2_main(int argc, char **argv)
        }
 
        if (opt & BUNZIP2_OPT_STDOUT) {
-               dst_fd = fileno(stdout);
+               dst_fd = STDOUT_FILENO;
        } else {
                int len = strlen(compressed_name) - 4;
                if (strcmp(compressed_name + len, ".bz2") != 0) {