8 int main(int argc, char **argv)
12 char buf[256], *z, *i;
14 p = getpwuid(getuid());
15 if (!p) { puts("You don't exist and thus you don't have a signature!"); return 1; }
17 f = open((argc > 1) ? argv[1] : ".sigbase", O_RDONLY);
18 if (f < 0) { puts("No file, no signature!"); return 1; }
19 while ((n = read(f, buf, sizeof(buf))) > 0) write(1, buf, n);
21 f = open(".misfortune", O_RDONLY);
22 if (!f || (len = lseek(f, 0, SEEK_END)) <= 0) {
23 puts("No fortune, no luck, no sig!");
26 lseek(f, 0, SEEK_SET);
28 if (!z) { puts("ENOMEM"); return 1; }
32 for(i=z; i<z+len; i++)
35 if (!n) { puts("Oh no! More lemmings!"); return 1; }
39 while (*z && *z != '\n') z++;
42 while (*z && *z != '\n') putchar(*z++);