typo fix in a comment in a testcase. oh well...
[oweals/busybox.git] / coreutils / split.c
index 2306789f0824d70060d43fdd1e763d7f0edd3d97..2191f30ea94727bcf114673a62c43b7518eeb183 100644 (file)
@@ -1,7 +1,7 @@
 /* vi: set sw=4 ts=4: */
 /*
  * split - split a file into pieces
- * Copyright (c) 2007 Bernhard Fischer
+ * Copyright (c) 2007 Bernhard Reutner-Fischer
  *
  * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
  */
@@ -20,7 +20,7 @@ static const struct suffix_mult split_suffices[] = {
 #if ENABLE_FEATURE_SPLIT_FANCY
        { "g", 1024*1024*1024 },
 #endif
-       { }
+       { "", 0 }
 };
 
 /* Increment the suffix part of the filename.
@@ -56,7 +56,7 @@ enum { READ_BUFFER_SIZE = COMMON_BUFSIZE - 1 };
 #define SPLIT_OPT_a (1<<2)
 
 int split_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
-int split_main(int argc ATTRIBUTE_UNUSED, char **argv)
+int split_main(int argc UNUSED_PARAM, char **argv)
 {
        unsigned suffix_len = 2;
        char *pfx;
@@ -98,7 +98,7 @@ int split_main(int argc ATTRIBUTE_UNUSED, char **argv)
        }
 
        while (1) {
-               bytes_read = safe_read(0, read_buffer, READ_BUFFER_SIZE);
+               bytes_read = safe_read(STDIN_FILENO, read_buffer, READ_BUFFER_SIZE);
                if (!bytes_read)
                        break;
                if (bytes_read < 0)
@@ -130,7 +130,7 @@ int split_main(int argc ATTRIBUTE_UNUSED, char **argv)
                                }
                        }
 
-                       xwrite(1, src, to_write);
+                       xwrite(STDOUT_FILENO, src, to_write);
                        bytes_read -= to_write;
                        src += to_write;
                } while (bytes_read);