Use errorMsg rather than fprintf.
diff --git a/dc.c b/dc.c
index 5bf3bc9..7b13cb9 100644
--- a/dc.c
+++ b/dc.c
@@ -22,7 +22,7 @@
static void push(double a)
{
if (pointer >= (sizeof(stack) / sizeof(*stack))) {
- fprintf(stderr, "dc: stack overflow\n");
+ errorMsg("stack overflow\n");
exit(-1);
} else
stack[pointer++] = a;
@@ -31,7 +31,7 @@
static double pop()
{
if (pointer == 0) {
- fprintf(stderr, "dc: stack underflow\n");
+ errorMsg("stack underflow\n");
exit(-1);
}
return stack[--pointer];
@@ -132,7 +132,7 @@
}
o++;
}
- fprintf(stderr, "dc: %s: syntax error.\n", argument);
+ errorMsg("%s: syntax error.\n", argument);
exit(-1);
}