Fixed a memory leak in lash. It seems that close_all was calling close()
[oweals/busybox.git] / dd.c
diff --git a/dd.c b/dd.c
index 32eeb661cf3aaef32a9f4c961e589d6c0d4b3739..1618dd102a81c50a8442691136ff169496c80936 100644 (file)
--- a/dd.c
+++ b/dd.c
  *
  */
 
-#include "busybox.h"
-
 #include <sys/types.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <string.h>
 #include <fcntl.h>
+#include "busybox.h"
+
 
-static struct suffix_mult dd_suffixes[] = {
+static const struct suffix_mult dd_suffixes[] = {
        { "c", 1 },
        { "w", 2 },
        { "b", 512 },
@@ -72,7 +76,7 @@ int dd_main(int argc, char **argv)
                                        sync = TRUE;
                                        buf += 4;
                                } else {
-                                       error_msg_and_die("invalid conversion `%s'\n", argv[i]+5);
+                                       error_msg_and_die("invalid conversion `%s'", argv[i]+5);
                                }
                                if (buf[0] == '\0')
                                        break;
@@ -80,7 +84,7 @@ int dd_main(int argc, char **argv)
                                        buf++;
                        }
                } else
-                       usage(dd_usage);
+                       show_usage();
        }
 
        buf = xmalloc(bs);