- va_start(args, fmt);
- vfprintf(stderr, fmt, args);
- va_end(args);
-
- if (fmt[0] != '\0' && fmt[strlen(fmt) -1] == ':')
- fprintf(stderr, " %s", strerror(errno));
- fprintf(stderr, "\n");
- exit(2); /* conventional value for failed execution */
-}
-
-/* emalloc - Taken from "Practice of Programming" by Kernighan and
- Pike. If memory allocatiion fails the program will print a message
- an exit. */
-static void *emalloc(size_t n) {
- void *p;
-
- p = malloc(n);
- if (p == NULL)
- eprintf("malloc of %u bytes failed:", n);