Use errorMsg rather than fprintf.
diff --git a/loadfont.c b/loadfont.c
index 7eaf40e..b3f9f4f 100644
--- a/loadfont.c
+++ b/loadfont.c
@@ -56,7 +56,7 @@
fd = open("/dev/tty0", O_RDWR);
if (fd < 0) {
- fprintf(stderr, "Error opening /dev/tty0: %s\n", strerror(errno));
+ errorMsg("Error opening /dev/tty0: %s\n", strerror(errno));
return( FALSE);
}
loadnewfont(fd);
@@ -72,7 +72,7 @@
memset(buf, 0, sizeof(buf));
if (unit < 1 || unit > 32) {
- fprintf(stderr, "Bad character size %d\n", unit);
+ errorMsg("Bad character size %d\n", unit);
exit(1);
}
@@ -112,7 +112,7 @@
up = (struct unipair *) malloc(maxct * sizeof(struct unipair));
if (!up) {
- fprintf(stderr, "Out of memory?\n");
+ errorMsg("Out of memory?\n");
exit(1);
}
for (glyph = 0; glyph < fontsize; glyph++) {
@@ -137,8 +137,8 @@
if (ioctl(fd, PIO_UNIMAPCLR, &advice)) {
#ifdef ENOIOCTLCMD
if (errno == ENOIOCTLCMD) {
- fprintf(stderr, "It seems this kernel is older than 1.1.92\n");
- fprintf(stderr, "No Unicode mapping table loaded.\n");
+ errorMsg("It seems this kernel is older than 1.1.92\n");
+ errorMsg("No Unicode mapping table loaded.\n");
} else
#endif
perror("PIO_UNIMAPCLR");
@@ -198,13 +198,13 @@
goto no_psf;
if (psfhdr.mode > PSF_MAXMODE) {
- fprintf(stderr, "Unsupported psf file mode\n");
+ errorMsg("Unsupported psf file mode\n");
exit(1);
}
fontsize = ((psfhdr.mode & PSF_MODE512) ? 512 : 256);
#if !defined( PIO_FONTX ) || defined( __sparc__ )
if (fontsize != 256) {
- fprintf(stderr, "Only fontsize 256 supported\n");
+ errorMsg("Only fontsize 256 supported\n");
exit(1);
}
#endif
@@ -214,7 +214,7 @@
head = head0 + fontsize * unit;
if (head > inputlth || (!hastable && head != inputlth)) {
- fprintf(stderr, "Input file: bad length\n");
+ errorMsg("Input file: bad length\n");
exit(1);
}
do_loadfont(fd, inbuf + head0, unit, fontsize);
@@ -231,7 +231,7 @@
} else {
/* bare font */
if (inputlth & 0377) {
- fprintf(stderr, "Bad input file size\n");
+ errorMsg("Bad input file size\n");
exit(1);
}
offset = 0;