X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=coreutils%2Fprintf.c;h=02d08118b76da025d0c403cc1da856f5554402ae;hb=2fe08c7afb3ddef42f304e78cb6edfa28e0741ef;hp=e79843c80ababd3964e9cbd16f7f5e1b70c5a1a8;hpb=cc8ed39b240180b58810784f844e253263594ac3;p=oweals%2Fbusybox.git diff --git a/coreutils/printf.c b/coreutils/printf.c index e79843c80..02d08118b 100644 --- a/coreutils/printf.c +++ b/coreutils/printf.c @@ -1,8 +1,3 @@ -// I may still need some more cleaning...fix my error checking - -#include "internal.h" -#ifdef BB_PRINTF - /* printf - format and print data Copyright (C) 90, 91, 92, 93, 94, 95, 1996 Free Software Foundation, Inc. @@ -51,6 +46,7 @@ // 19990508 Busy Boxed! Dave Cinege +#include "internal.h" #include #include #include @@ -140,15 +136,18 @@ static void verify __P ((char *s, char *end)); /* The value to return to the calling program. */ static int exit_status; -const char printf_usage[] = "Usage: printf format [argument...]\n"; +static const char printf_usage[] = "printf format [argument...]\n"; int -printf_main(struct FileInfo * i, int argc, char * * argv) +printf_main(int argc, char** argv) { char *format; int args_used; exit_status = 0; + if ( **(argv+1) == '-' ) { + usage (printf_usage); + } format = argv[1]; argc -= 2; @@ -528,4 +527,3 @@ verify (char *s, char *end) } } -#endif