X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=dc.c;h=d462100a21166e42c939915de6b0f761a1ed5253;hb=46f44d24fcc25a5d6e13e0453485881bdf147e91;hp=48aa830d6117ffb676c00be3910ae79f05afd5ca;hpb=3570a34de46b1f7dedd16999bb1687e2d6b55d40;p=oweals%2Fbusybox.git diff --git a/dc.c b/dc.c index 48aa830d6..d462100a2 100644 --- a/dc.c +++ b/dc.c @@ -13,19 +13,15 @@ static unsigned int pointer; static void push(double a) { - if (pointer >= (sizeof(stack) / sizeof(*stack))) { - errorMsg("stack overflow\n"); - exit(-1); - } else - stack[pointer++] = a; + if (pointer >= (sizeof(stack) / sizeof(*stack))) + error_msg_and_die("stack overflow\n"); + stack[pointer++] = a; } static double pop() { - if (pointer == 0) { - errorMsg("stack underflow\n"); - exit(-1); - } + if (pointer == 0) + error_msg_and_die("stack underflow\n"); return stack[--pointer]; } @@ -124,8 +120,7 @@ static void stack_machine(const char *argument) } o++; } - errorMsg("%s: syntax error.\n", argument); - exit(-1); + error_msg_and_die("%s: syntax error.\n", argument); } /* return pointer to next token in buffer and set *buffer to one char @@ -182,5 +177,5 @@ int dc_main(int argc, char **argv) } } stack_machine(0); - return( TRUE); + return EXIT_SUCCESS; }