- inputlth = fread(inbuf, 1, sizeof(inbuf), stdin);
- if (ferror(stdin))
- perror_msg_and_die("Error reading input font");
- /* 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_msg_and_die("Font too large");
+ 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");