projects
/
platform
/
upstream
/
libHarfBuzzSharp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5673842
)
[util] Use fgets instead of getline such that windows passes
author
Behdad Esfahbod
<behdad@behdad.org>
Tue, 30 Oct 2018 08:35:58 +0000
(
01:35
-0700)
committer
Behdad Esfahbod
<behdad@behdad.org>
Tue, 30 Oct 2018 08:35:58 +0000
(
01:35
-0700)
util/hb-shape.cc
patch
|
blob
|
history
diff --git
a/util/hb-shape.cc
b/util/hb-shape.cc
index
6c727d0
..
1a67123
100644
(file)
--- a/
util/hb-shape.cc
+++ b/
util/hb-shape.cc
@@
-163,9
+163,8
@@
main (int argc, char **argv)
if (argc == 2 && !strcmp (argv[1], "--batch"))
{
unsigned int ret = 0;
- char *buf = nullptr;
- size_t len;
- while (getline (&buf, &len, stdin) > 0)
+ char buf[4092];
+ while (fgets (buf, sizeof (buf), stdin))
{
size_t l = strlen (buf);
if (l && buf[l - 1] == '\n') buf[l - 1] = '\0';
@@
-187,7
+186,6
@@
main (int argc, char **argv)
if (ret)
break;
}
- free (buf);
return ret;
}
main_font_text_t<shape_consumer_t<output_buffer_t>, FONT_SIZE_UPEM, 0> driver;