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 committed 2012-12-27 01:57:09 +00:00
1 parent d327772dfc
commit 52db8000c6
1 file changed
+1 -1
+1 -1
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;
}