Fix cat and wc
Trying to fit 64K onto stack was a bad idea.
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
#define BLOCK_SIZE 65536
|
||||
|
||||
exit_code_t pass(uint64_t fd) {
|
||||
char buffer[BLOCK_SIZE];
|
||||
static char buffer[BLOCK_SIZE];
|
||||
uint64_t bytes;
|
||||
while ((bytes = read(fd, BLOCK_SIZE, buffer))) {
|
||||
if (bytes == (uint64_t)-1) {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#define BLOCK_SIZE 65536
|
||||
|
||||
exit_code_t pass(uint64_t fd) {
|
||||
char buffer[BLOCK_SIZE];
|
||||
static char buffer[BLOCK_SIZE];
|
||||
uint64_t bytes;
|
||||
uint64_t total = 0;
|
||||
while ((bytes = read(fd, BLOCK_SIZE, buffer))) {
|
||||
|
||||
Reference in New Issue
Block a user