[util] Use fgets instead of getline such that windows passes
This commit is contained in:
parent
56738429d6
commit
edaa768253
|
@ -163,9 +163,8 @@ main (int argc, char **argv)
|
||||||
if (argc == 2 && !strcmp (argv[1], "--batch"))
|
if (argc == 2 && !strcmp (argv[1], "--batch"))
|
||||||
{
|
{
|
||||||
unsigned int ret = 0;
|
unsigned int ret = 0;
|
||||||
char *buf = nullptr;
|
char buf[4092];
|
||||||
size_t len;
|
while (fgets (buf, sizeof (buf), stdin))
|
||||||
while (getline (&buf, &len, stdin) > 0)
|
|
||||||
{
|
{
|
||||||
size_t l = strlen (buf);
|
size_t l = strlen (buf);
|
||||||
if (l && buf[l - 1] == '\n') buf[l - 1] = '\0';
|
if (l && buf[l - 1] == '\n') buf[l - 1] = '\0';
|
||||||
|
@ -187,7 +186,6 @@ main (int argc, char **argv)
|
||||||
if (ret)
|
if (ret)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
free (buf);
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
main_font_text_t<shape_consumer_t<output_buffer_t>, FONT_SIZE_UPEM, 0> driver;
|
main_font_text_t<shape_consumer_t<output_buffer_t>, FONT_SIZE_UPEM, 0> driver;
|
||||||
|
|
Loading…
Reference in New Issue