Fixed segfault with 'cut -f 1 -d:' and added 'cut -s' suport.
[oweals/busybox.git] / sync.c
diff --git a/sync.c b/sync.c
index b9f52c8b08793907f3a914450242223bcec1a5bd..db35d72faec2aacb8e5f1b924e4a13c5714d3454 100644 (file)
--- a/sync.c
+++ b/sync.c
@@ -1,3 +1,4 @@
+/* vi: set sw=4 ts=4: */
 /*
  * Mini sync implementation for busybox
  *
 #include "internal.h"
 #include <stdio.h>
 
-extern int
-sync_main(int argc, char * * argv)
+extern int sync_main(int argc, char **argv)
 {
-    if ( **(argv+1) == '-' ) {
-       usage( "sync\nWrite all buffered filesystem blocks to disk.\n");
-    }
-    return sync();
+       if (argc > 1 && **(argv + 1) == '-') {
+               usage("sync\n"
+#ifndef BB_FEATURE_TRIVIAL_HELP
+                               "\nWrite all buffered filesystem blocks to disk.\n"
+#endif
+                               );
+       }
+       return(sync());
 }
-