- inputlth = fread(inbuf, 1, sizeof(inbuf), stdin);
- if (ferror(stdin)) {
- perror("Error reading input font");
- exit(1);
- }
- /* use malloc/realloc in case of giant files;
- maybe these do not occur: 16kB for the font,
- and 16kB for the map leaves 32 unicode values
- for each font position */
- if (!feof(stdin)) {
- perror("Font too large");
- exit(1);
- }
+ inputlth = full_read(STDIN_FILENO, inbuf, INBUF_SIZE);
+ if (inputlth < 0)
+ bb_perror_msg_and_die("error reading input font");
+ if (inputlth >= INBUF_SIZE)
+ bb_error_msg_and_die("font too large");