Commit | Line | Data |
---|---|---|
520d5775 EA |
1 | # include "iodec.h" |
2 | ||
3 | /** | |
4 | ** output an error message and exit | |
5 | **/ | |
6 | ||
7 | __error(parlist) | |
8 | char *parlist; | |
9 | { | |
10 | register char *fmt; | |
11 | register char **p; | |
12 | char buf[10], *s; | |
13 | register int c; | |
14 | extern char *__prtshort(); | |
15 | extern int cout; | |
16 | ||
17 | p = &parlist; | |
18 | fmt = *p++; | |
19 | ||
20 | while (c = *fmt++) | |
21 | { | |
22 | if (c != '%') | |
23 | { | |
24 | cputc(c, cout); | |
25 | continue; | |
26 | } | |
27 | c = *fmt++; | |
28 | switch (c) | |
29 | { | |
30 | ||
31 | case 'd': | |
32 | s = buf; | |
33 | __prtint(p++, buf, 10, 1, __prtshort, 0); | |
34 | break; | |
35 | ||
36 | case 's': | |
37 | s = *p++; | |
38 | break; | |
39 | ||
40 | } | |
41 | while (*s) | |
42 | cputc(*s++, cout); | |
43 | } | |
44 | cputc('\n', cout); | |
45 | ||
46 | flush(); | |
47 | abort(); | |
48 | } |