We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents d1be9e6 + 1580491 commit 2037df9Copy full SHA for 2037df9
wc-l-syscall.c
@@ -43,7 +43,7 @@ do_word_count(int fd, const char *path)
43
if (n < 0) die(path);
44
if (n == 0) break;
45
unsigned long i;
46
- for (i = 0; i < BUFFER_SIZE; i++) {
+ for (i = 0; i < n; i++) {
47
if (buf[i] == '\n') {
48
count++;
49
}
0 commit comments