1
0
mirror of https://github.com/stedolan/jq.git synced 2024-05-11 05:55:39 +00:00

Fix an embarassing I/O bug.

Pulling some I/O out to a function meant that buf changed from
"char buf[4096]" to "char* buf", and "sizeof(buf)" got a lot
less interesting. The upshot of this is that jq read input eight
bytes at a time, which is not the fastest.
This commit is contained in:
Stephen Dolan
2012-12-27 01:57:09 +00:00
parent d327772dfc
commit 52db8000c6

2
main.c
View File

@ -135,7 +135,7 @@ static int read_more(char* buf, size_t size) {
next_input_idx++;
}
if (!fgets(buf, sizeof(buf), current_input)) buf[0] = 0;
if (!fgets(buf, size, current_input)) buf[0] = 0;
return 1;
}