aboutsummaryrefslogtreecommitdiff
path: root/console-tools/loadfont.c
diff options
context:
space:
mode:
authorMatt Kraai <kraai@debian.org>2000-07-14 01:51:25 +0000
committerMatt Kraai <kraai@debian.org>2000-07-14 01:51:25 +0000
commitd537a95fdbc0b4a5f38edea8593b4c085fdd7fcb (patch)
tree62127f20fc07758e445d8c4e186306cbe83d77b1 /console-tools/loadfont.c
parent4ac6cb534d78d63d7b0a206118c56bad7024b9f8 (diff)
downloadbusybox-w32-d537a95fdbc0b4a5f38edea8593b4c085fdd7fcb.tar.gz
busybox-w32-d537a95fdbc0b4a5f38edea8593b4c085fdd7fcb.tar.bz2
busybox-w32-d537a95fdbc0b4a5f38edea8593b4c085fdd7fcb.zip
Use errorMsg rather than fprintf.
Diffstat (limited to 'console-tools/loadfont.c')
-rw-r--r--console-tools/loadfont.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/console-tools/loadfont.c b/console-tools/loadfont.c
index 7eaf40e82..b3f9f4f11 100644
--- a/console-tools/loadfont.c
+++ b/console-tools/loadfont.c
@@ -56,7 +56,7 @@ extern int loadfont_main(int argc, char **argv)
56 56
57 fd = open("/dev/tty0", O_RDWR); 57 fd = open("/dev/tty0", O_RDWR);
58 if (fd < 0) { 58 if (fd < 0) {
59 fprintf(stderr, "Error opening /dev/tty0: %s\n", strerror(errno)); 59 errorMsg("Error opening /dev/tty0: %s\n", strerror(errno));
60 return( FALSE); 60 return( FALSE);
61 } 61 }
62 loadnewfont(fd); 62 loadnewfont(fd);
@@ -72,7 +72,7 @@ static void do_loadfont(int fd, char *inbuf, int unit, int fontsize)
72 memset(buf, 0, sizeof(buf)); 72 memset(buf, 0, sizeof(buf));
73 73
74 if (unit < 1 || unit > 32) { 74 if (unit < 1 || unit > 32) {
75 fprintf(stderr, "Bad character size %d\n", unit); 75 errorMsg("Bad character size %d\n", unit);
76 exit(1); 76 exit(1);
77 } 77 }
78 78
@@ -112,7 +112,7 @@ do_loadtable(int fd, unsigned char *inbuf, int tailsz, int fontsize)
112 up = (struct unipair *) malloc(maxct * sizeof(struct unipair)); 112 up = (struct unipair *) malloc(maxct * sizeof(struct unipair));
113 113
114 if (!up) { 114 if (!up) {
115 fprintf(stderr, "Out of memory?\n"); 115 errorMsg("Out of memory?\n");
116 exit(1); 116 exit(1);
117 } 117 }
118 for (glyph = 0; glyph < fontsize; glyph++) { 118 for (glyph = 0; glyph < fontsize; glyph++) {
@@ -137,8 +137,8 @@ do_loadtable(int fd, unsigned char *inbuf, int tailsz, int fontsize)
137 if (ioctl(fd, PIO_UNIMAPCLR, &advice)) { 137 if (ioctl(fd, PIO_UNIMAPCLR, &advice)) {
138#ifdef ENOIOCTLCMD 138#ifdef ENOIOCTLCMD
139 if (errno == ENOIOCTLCMD) { 139 if (errno == ENOIOCTLCMD) {
140 fprintf(stderr, "It seems this kernel is older than 1.1.92\n"); 140 errorMsg("It seems this kernel is older than 1.1.92\n");
141 fprintf(stderr, "No Unicode mapping table loaded.\n"); 141 errorMsg("No Unicode mapping table loaded.\n");
142 } else 142 } else
143#endif 143#endif
144 perror("PIO_UNIMAPCLR"); 144 perror("PIO_UNIMAPCLR");
@@ -198,13 +198,13 @@ static void loadnewfont(int fd)
198 goto no_psf; 198 goto no_psf;
199 199
200 if (psfhdr.mode > PSF_MAXMODE) { 200 if (psfhdr.mode > PSF_MAXMODE) {
201 fprintf(stderr, "Unsupported psf file mode\n"); 201 errorMsg("Unsupported psf file mode\n");
202 exit(1); 202 exit(1);
203 } 203 }
204 fontsize = ((psfhdr.mode & PSF_MODE512) ? 512 : 256); 204 fontsize = ((psfhdr.mode & PSF_MODE512) ? 512 : 256);
205#if !defined( PIO_FONTX ) || defined( __sparc__ ) 205#if !defined( PIO_FONTX ) || defined( __sparc__ )
206 if (fontsize != 256) { 206 if (fontsize != 256) {
207 fprintf(stderr, "Only fontsize 256 supported\n"); 207 errorMsg("Only fontsize 256 supported\n");
208 exit(1); 208 exit(1);
209 } 209 }
210#endif 210#endif
@@ -214,7 +214,7 @@ static void loadnewfont(int fd)
214 214
215 head = head0 + fontsize * unit; 215 head = head0 + fontsize * unit;
216 if (head > inputlth || (!hastable && head != inputlth)) { 216 if (head > inputlth || (!hastable && head != inputlth)) {
217 fprintf(stderr, "Input file: bad length\n"); 217 errorMsg("Input file: bad length\n");
218 exit(1); 218 exit(1);
219 } 219 }
220 do_loadfont(fd, inbuf + head0, unit, fontsize); 220 do_loadfont(fd, inbuf + head0, unit, fontsize);
@@ -231,7 +231,7 @@ static void loadnewfont(int fd)
231 } else { 231 } else {
232 /* bare font */ 232 /* bare font */
233 if (inputlth & 0377) { 233 if (inputlth & 0377) {
234 fprintf(stderr, "Bad input file size\n"); 234 errorMsg("Bad input file size\n");
235 exit(1); 235 exit(1);
236 } 236 }
237 offset = 0; 237 offset = 0;