X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;ds=sidebyside;f=dc.c;h=8d7a92a2802f5c871f40a4cb65bafd22667d9abe;hb=ce4a586edb6abd90c1036666159f831bd2a58895;hp=d462100a21166e42c939915de6b0f761a1ed5253;hpb=f57c944e09417edcbcd69f2b01b937cadef39db2;p=oweals%2Fbusybox.git diff --git a/dc.c b/dc.c index d462100a2..8d7a92a28 100644 --- a/dc.c +++ b/dc.c @@ -1,10 +1,11 @@ /* vi: set sw=4 ts=4: */ -#include "busybox.h" #include #include #include +#include #include #include +#include "busybox.h" /* Tiny RPN calculator, because "expr" didn't give me bitwise operations. */ @@ -14,14 +15,14 @@ static unsigned int pointer; static void push(double a) { if (pointer >= (sizeof(stack) / sizeof(*stack))) - error_msg_and_die("stack overflow\n"); + error_msg_and_die("stack overflow"); stack[pointer++] = a; } static double pop() { if (pointer == 0) - error_msg_and_die("stack underflow\n"); + error_msg_and_die("stack underflow"); return stack[--pointer]; } @@ -120,7 +121,7 @@ static void stack_machine(const char *argument) } o++; } - error_msg_and_die("%s: syntax error.\n", argument); + error_msg_and_die("%s: syntax error.", argument); } /* return pointer to next token in buffer and set *buffer to one char @@ -169,7 +170,7 @@ int dc_main(int argc, char **argv) } } else { if (*argv[1]=='-') - usage(dc_usage); + show_usage(); while (argc >= 2) { stack_machine(argv[1]); argv++;